Strange variable

Post » Mon Nov 28, 2011 1:12 pm

Hello @ll,

i have defined a float variable x

but when i try to get its value with PrintC " Variable x: %0.4f", x

the output is : -1.#IND

What does this mean?
User avatar
Stephanie Kemp
 
Posts: 3329
Joined: Sun Jun 25, 2006 12:39 am

Post » Mon Nov 28, 2011 3:31 pm

Put in a few more debug messages, and track it's value. I have no clue what that means, it shouldn't even be able to do that.
User avatar
Yama Pi
 
Posts: 3384
Joined: Wed Apr 18, 2007 3:51 am

Post » Mon Nov 28, 2011 2:42 pm

Put in a few more debug messages, and track it's value. I have no clue what that means, it shouldn't even be able to do that.

thanks, for your honest answer!
User avatar
Irmacuba
 
Posts: 3531
Joined: Sat Mar 31, 2007 2:54 am

Post » Tue Nov 29, 2011 2:31 am

You don't happen to have two different types of variables with the same name do you? (yeah, I know, wild shot in the dark.)
User avatar
Amie Mccubbing
 
Posts: 3497
Joined: Thu Aug 31, 2006 11:33 pm

Post » Mon Nov 28, 2011 8:45 pm

Hello @ll,

i have defined a float variable x

but when i try to get its value with PrintC " Variable x: %0.4f", x

the output is : -1.#IND

What does this mean?

Maybe I'm wrong, but I don't think there is suppose to be a comma separating the first varible to be printed and the last quotation mark.
I think your statement should look like this:
PrintC " Variable x: %0.4f" x
User avatar
Abi Emily
 
Posts: 3435
Joined: Wed Aug 09, 2006 7:59 am

Post » Mon Nov 28, 2011 2:51 pm

The comma is optional but won't cause a problem. Looks like... x is indefinite, maybe? That's... not really a valid option for a number, usually... though if x were a ref variable, and tried to get parsed as a float... only thing I can think of, anyway.

Well, that or that it's thinking you mean the X axis (used as an argument for things like SetPos); normally you can use a variable called x because it's clear from context which it is, but perhaps with format string stuff (which is inherently untyped), it can't tell?
User avatar
Gavin Roberts
 
Posts: 3335
Joined: Fri Jun 08, 2007 8:14 pm


Return to IV - Oblivion