UnderwareDESIGN

PlayBASIC => Beginners => Topic started by: Scott_Bro on September 01, 2021, 04:35:01 AM

Title: General Question
Post by: Scott_Bro on September 01, 2021, 04:35:01 AM
I seem to be confused about something.
Can anyone help?

How do I convert a string to float?

I see a string and it looks good. (floating-point) deceimal example: 0.005798   0.095668 ect,,,

as a sting that's kewl but...

as soon as I make it a float it nolonger looks the same.
I feel dumb. I missing something.

I want to be able to read in float value and they do as strings but
I want to store them as floats.

Weired aw? What am I not seeing?

Thanks
Scott_Bro
Title: Re: General Question
Post by: kevin on September 01, 2021, 08:07:57 AM

the Val#() function converts a string to a float
Title: Re: General Question
Post by: Scott_Bro on September 01, 2021, 12:40:34 PM
Thsnks!

It's just that sometimes floats confuse me because they look different sometimes.

Why? Maybe, Kevin can explain it better too me.
Title: Re: General Question
Post by: kevin on September 01, 2021, 09:12:08 PM
  if you display or convert a float to string that's really big or small it'll be noted using exponents.  


  https://en.wikipedia.org/wiki/Single-precision_floating-point_format