Go Down

Topic: +infinity and -infinity? (Read 3543 times) previous topic - next topic

aaronjohnsonx

Hi all,
I'm new to Arduino and was wondering how to set a variable to +infinity or -infinity or get something along the same lines. Using this for alpha beta pruning. Thanks a lot!

PaulS

Quote
was wondering how to set a variable to +infinity or -infinity

Code: [Select]
char *variable = "+infinity";
is one way.

Some context might even provide an answer that made sense.

Quote
Using this for alpha beta pruning.

Say what?
The art of getting good answers lies in asking good questions.

UKHeliBob


Hi all,
I'm new to Arduino and was wondering how to set a variable to +infinity or -infinity or get something along the same lines. Using this for alpha beta pruning. Thanks a lot!

What type of variable did you have in mind ?   :)
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

AWOL

#3
Apr 01, 2014, 11:27 am Last Edit: Apr 01, 2014, 11:29 am by AWOL Reason: 1
Quote
What type of variable did you have in mind ?

signed long long long long long long long long long long long long long long long long long long long long long longaleph

KeithRB

If this is an integer, infinity is not very infinite! You can use the defines in limits.h, for example:

INT_MAX

(For negative infinity you have INT_MIN)

FLT_MAX

and so on

UKHeliBob


Quote
What type of variable did you have in mind ?

signed long long long long long long long long long long long long long long long long long long long long long longaleph
Now we have the type sorted out we need a name for the variable.  buzzLightyear, perhaps.
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

econjack

@Keith: Helpful. The rest of you: The poor guy's first post and you probably sent him running scared into some cave and we'll never see him again. Perhaps we should let someone's first post pass unscathed. After that, especially if it's clear the poster hasn't read the stickies, then they are fair game.

AWOL

Alpha beta pruning suggests a passing acquaintance with computing terms.

econjack

@AWOL: Don't see how that affects the way he's treated here on his first post. Knowing computer terms doesn't make one bullet proof. Paul, especially, has a gift for making comments that I really enjoy reading. However, people who are new to this forum need to know that, if they play by the Rules, they can get valuable insight on whatever problems they face.  I just don't want to discourage the OP from returning here when they need help.

Go Up