2k views

Permanently rounding numbers/values to a given number of significant figures

I am searching for a simple way of rounding and setting an input to a desired number of significant figures. There are a vast number of posts that discuss similar problems, but none address this issue....
284 views

How to prevent Round with hided fractions

I found a strange behavior in Round. If we try: ToString[Round[4.811, 0.01], InputForm] we get: 4.8100000000000005 When I expected 4.81 In order to get ...
1k views

Elegant high precision log1p?

Sometimes it is hard to understand how numerical expressions are evaluated. I remember reading claims by Wolfram on how smart the Kernel is to evaluate expressions trees numerically by recognizing ...
3k views

Meaning of backtick in floating-point literal

If I compute, say, 1/3//N, Mathematica displays 0.333333 as the result. When I copy that output to use elsewhere, the paste ...
754 views

Dr. StrangeNumbers or: How I Learned to Stop Worrying and Love Floating Point Arithmetic

The following is the program. ...
422 views

DeleteCases messing with my mind

I'm losing my mind. Please tell me my laptop is doing weird things and not me. Or do I need to get committed someplace? ...
254 views

Why to do parentheses change the results of a calculation?

I'm getting results that are sensitive to where I place parentheses with respect to operations that are associative1 (and should thus be insensitive to such placement). For example, if I define2 <...
134 views

Rounding Errors in simple Range/Table output

I get strange rounding errors from MachinePrecision values from Export. From this: InputForm[Range[99.9997, 100.0003, 0.0001]] I get: ...
157 views

Floating point arithmetic bug caused by Table[]

I was doing something fairly ordinary and noticed something I can't, for the life of me, explain. For context, I wanted to take make a function that takes an array of data like the one below, then an ...
111 views

Why is Sin[2.0 Pi] = -2.44929 x 10^-16 and not 0.0?

Why does Sin[2.0 Pi] evaluate to -2.44929 x 10^-16 and not 0.0?