Could someone tell me why "959440.94f" return false? thanks


  • 1
    Q

    Could someone tell me why "959440.94f" return false? thanks.

    the following code words well in eclipse:
    float a = 959440.94f;


  • 0
    N

    From the creator's note

    Note: It is intended for the problem statement to be ambiguous. You
    should gather all requirements up front before implementing one.

    I think he/she only want the string to include "valid number only" where float literal is not included.
    I know in Java or C++ float literal is represented by f, but not in python and maybe another language too I think that's why he/she decide it's not a "valid number".


  • 0
    Q

    thanks ^_^ ..........(for at least 12 characters).........


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.