although I define the Field input to store the division result with an 8 digit format.
144 / 17
my division operation seems to only return 6 digits after coma.
Var nombre As Double = input1.Value.ToInteger
Var quotien As Double = input2.Value.ToInteger
Var x As Double
x = nombre /quotien
ResuDIV.Value = x.ToString
Is there a way/Format that cab retreive more digits ?
such as :
Thanks for the tips
ResuDIV.Value = x.ToString("0.################################################")
Note that precision is limited, so not accurate after a specific decimal depth.
the “0” says use a numeric value, if none available set to 0.
the “#” means show a value if there is one otherwise show none.
mmm…so Xojo offers no choice to get a larger decimal depth, at all ?
Xojo? It’s your computer that can’t give better precision. You should look up double precision here:
Double-precision floating-point format is a computer number format, usually occupying 64 bits in computer memory; it represents a wide dynamic range of numeric values by using a floating radix point.
Floating point is used to represent fractional values, or when a wider range is needed than is provided by fixed point (of the same bit width), even if at the cost of precision. Double precision may be chosen when the range or precision of single precision would be insufficient.
In the IEEE 754-200...
There was a plugin for that, but I forgot the names.
Ok it’s the decimal plugin, here is another one…
Thanks guys, I will try to install this plugin…
@DerkJ one calculator on my Os returns : 144:17 = 8,47058823529411764706
google says 144 / 17 = 8.47058823529 thats as much as you can squees out of it.
Most calculators show you the “safe” length.
As for this plugin
@AlbertoD is sharing
The note mentions : “…fp Plugin is compiled for Mac OS X, Windows, and Linux.”
Do I have to understand that I will always get the exact same precision for a division on all 3 OS :
@DerkJ seems to point out… only the 6 first decimal will be safe on all of these OSes ?
I’m not sure about the actual length if decimals that will be precise as it depends on the length of the left part i guess. Maybe
@Christian_Schmitz or @Tim_Hare know the correct answers for this?
Double has max 15 digits precision.
Does not matter where the decimal dot is.
BigNumberMBS and LargeNumberMBS classes in our plugin for large float/integer values.
Hi Alberto, I 'm trying to figure out how to make use of this plugin in my script (so as to see it in action) I’ve never config plugin use in Xojo - only made a copy of fpPlugin.zip in the plugin folder…
Would you know how to set it up in an Action button for my division ?
I only have experience with Decimal Plugin.
copy ‘Decimal Plugin.xojo_plugin’ to Xojo’s Plugin folder
put this code in Action event:
var nombre as decimal = 144
var quotien as decimal = 17
var x as Decimal
x = nombre / quotien
ResuDIV.Value = str(x)
str(x) will be 8.4705882352941176470588235 because we set the scale to 25, if you set it to 20 you will get the same result as your OS calculator.
yes. fpplugin has been completely rewritten to calculate the same manner on all platforms.
Great… now this one (or all plugin?) does not mention the IOS plateform.
Is it possible that this very plugin is not built to operate on IOs Mobile device ?
How about Web App ?
Thanks a lot for all these details…
oh, it needs to be unziped too