Page 1 of 2

Float scientific notation

PostPosted: Fri Jun 16, 2017 2:59 am
by pshannon
Hello All,

I have tried so many different ways to make this work, but anytime you reach a 7 digit number(1,000,000=1e-006) the float value box will convert it to scientific notation. I want to display the actual number visually through DSP and not ruby. Thanks

QUADBIT

Re: Float scientific notation

PostPosted: Sat Jun 17, 2017 1:03 pm
by pshannon
Hello All,

Not trying to come across rude here, but I figured my previous post would be common knowledge to the the support staff or some veterans of the software. No one knows how to display large floating point numbers without using scientific notation? Even if the reply states that it is a limitation of the Float value display, but I am really disappointed by the lack of the support here with the DSP robotics team that is supposed to be checking the forum everyday.
It really appears the forums are dying compared to when I first bought the software 2 years ago. I am just getting back into the scene with it and I was diving into some new possibilities with the software.

Regards,

QuadBIT

Re: Float scientific notation

PostPosted: Sat Jun 17, 2017 3:18 pm
by Spogg
Hi

I see the original post has been viewed 31 times at the moment. So you aren't being ignored. Personally I don't know but I bet someone does. I would like to see this answered too because something in my poor old brain shuts down when I see scientific notation :(

Cheers

Spogg

Re: Float scientific notation

PostPosted: Sat Jun 17, 2017 4:42 pm
by martinvicanek
You can do this but frankly I would recommend Ruby. The Format String module is very picky about the format input: FS will crash on invalid specifier strings! :o :roll: :x

Re: Float scientific notation

PostPosted: Sat Jun 17, 2017 5:00 pm
by tulamide
pshannon wrote:Hello All,

Not trying to come across rude here, but I figured my previous post would be common knowledge to the the support staff or some veterans of the software. No one knows how to display large floating point numbers without using scientific notation? Even if the reply states that it is a limitation of the Float value display, but I am really disappointed by the lack of the support here with the DSP robotics team that is supposed to be checking the forum everyday.
It really appears the forums are dying compared to when I first bought the software 2 years ago. I am just getting back into the scene with it and I was diving into some new possibilities with the software.

Regards,

QuadBIT

To be honest, it's your own fault. I'm a Ruby guy, so when I read you don't want to use Ruby, I didn't answer. Other than that, we all know that we only can help each other. I never saw the DSP team answering any question.

Re: Float scientific notation

PostPosted: Sat Jun 17, 2017 5:06 pm
by tulamide
Spogg wrote:I would like to see this answered too because something in my poor old brain shuts down when I see scientific notation :(

But it isn't as scary as it might seem. Just ignore the "e" and look at the numbering. In this case it says +6 which you should interpret as a simple instruction: Move the dot 6 digits to the right. If it says -6 it's the other direction: Move the dot six digits to the left. Nothing more.

1000000000000000
1e+15

Which of the two is easier to identify? I wouldn't want to count the zeroes :lol: In this case the scientific notation literally means: A 'one' with 15 'zeroes'.

Re: Float scientific notation

PostPosted: Sat Jun 17, 2017 5:33 pm
by Spogg
tulamide wrote:
Spogg wrote:I would like to see this answered too because something in my poor old brain shuts down when I see scientific notation :(

But it isn't as scary as it might seem. Just ignore the "e" and look at the numbering. In this case it says +6 which you should interpret as a simple instruction: Move the dot 6 digits to the right. If it says -6 it's the other direction: Move the dot six digits to the left. Nothing more.

1000000000000000
1e+15

Which of the two is easier to identify? I wouldn't want to count the zeroes :lol: In this case the scientific notation literally means: A 'one' with 15 'zeroes'.


Hey that's a good explanation tulamide, thanks :D

Spogg

Re: Float scientific notation

PostPosted: Sat Jun 17, 2017 6:09 pm
by pshannon
Thanks for the replies, however, I have coded in many languages over the past 35 years and I assumed it was more of a setting to display a much much larger number. With today's memory, cpu and 32-64 bit processing, was it too much to ask or assume that it could do this without conversions? I can try to learn Ruby, but I was just thinking I have to learn yet another language. I was recently brushing back up on my ASM skills and I am not really fond of interpreted coding. I like speed. So now I know it is error prone to use the DSP module to convert this, what do you ruby guys have in mind for displaying the same thing? I assume a float value to string?

Thanks,

QuadBIT

Re: Float scientific notation

PostPosted: Sat Jun 17, 2017 7:05 pm
by pshannon
Here is my ruby simple code. It comes out with a strange error during the conversion.

The integer box does not covert the 9 digit number as you can see, but the next steps are different values. I tried to keep it simple with 123456789, but it converted to 123456792. Some thoughts? Thanks

Re: Float scientific notation

PostPosted: Sat Jun 17, 2017 8:30 pm
by TheOm
Not all integers that are representable in a 32bit int are also representable in a 32bit float.
Ints smaller than or equal to 2^24 (16.777.216) are all guaranteed to roundtrip through a float, ints bigger than that (like 123456789) might get rounded to the closest float.