floatValue()

From Hack Wars Wiki

Jump to: navigation, search


Information for free function floatValue()
Function floatValue(int value)
API Attacking, Banking, FTP, Watch, HTTP, Challenges
Description Returns a float of the value given.


Challenge Script Example

Sometimes you have an integer you want to pass to a function but the function requires it as a float. The required conversion can be done with this function.

int main(){
float a = sin(floatValue(270));
setOutputFloat(a);
}

Float Outputted: -1.0

Alternatives

There are other ways which do the same like floatValue()

This will convert 270 explicitly to a float.

int main(){
float a = sin( (float) 270);
setOutputFloat(a);
}


If you use fixed values then you can simply add ".0" after the number.

int main(){
float a = sin( 270.0 );
setOutputFloat(a);
}
Personal tools