30 votes

How to enter a repeating decimal in Mathematica

Indeed, there is no direct method to input a repeating decimal. The closest you can get is to input the repeating digits into FromDigits[]: $$0.\overline{142857}$$ <...
20 votes
Accepted

Understanding simple numerical calculation

Introduction This seems to be a question more about IEEE 754 binary64 format than about Mathematica per se. The significand is 53 bits (52 stored, since the leading bit is assumed to be ...
Michael E2's user avatar
  • 234k
16 votes

How to enter a repeating decimal in Mathematica

Use the ResourceFunction RepeatingDecimalToRational: ...
Bob Hanlon's user avatar
  • 155k
14 votes
Accepted

Making the number 12345...n

FromDigits@Flatten[IntegerDigits /@ Range[15]] 123456789101112131415 A function to do it: ...
murray's user avatar
  • 11.8k
12 votes
Accepted

How to force Mathematica to do infinite-precision calculations?

Mathematica will perform exact arithmetic only so long as all quantities are expressed as exact numbers. 90.12 is an inexact number with machine precision (i.e. ...
WReach's user avatar
  • 68.6k
11 votes
Accepted

Checking if a number is right sorted

f1 = OrderedQ @* Rest @* IntegerDigits; f1 /@ {51369, 51396} {True, False} ...
kglr's user avatar
  • 392k
11 votes
Accepted

IntegerPart - is this a known bug?

[H]ow do I fix it once and for all for the entire Notebook? I suppose it depends on how you want to treat results that contain round-off error. You cannot really get rid of the problem, only shift ...
Michael E2's user avatar
  • 234k
10 votes
Accepted

How to get exact Rationalize of a decimal number?

You can use SetPrecision to find a more precise result. ...
Karsten7's user avatar
  • 27.4k
10 votes

Test if number represents an integer

you can try this: integerQ[x_] := x == Round[x]
partida's user avatar
  • 6,786
10 votes

How to write an array of repeated numbers as a single number

That can easily be done by separating each number into digits and re-assembling them as Number {3097, 3097, 3097, 3097} // IntegerDigits // Flatten // FromDigits
halirutan's user avatar
  • 113k
10 votes

Making the number 12345...n

f1 = FromDigits @ StringRiffle[Range[#], ""] &; f1 /@ {4, 10, 15} {1234, 12345678910, 123456789101112131415} ...
kglr's user avatar
  • 392k
10 votes

Trace shows Linux has worse error than Windows in 1/(-1.)^1.2

This made me curious. I work under macos on Apple Silicon. I get these results: ...
Henrik Schumacher's user avatar
9 votes

Arbitrary-Precision Arithmetic behaves unexpectedly

This is at best a partial answer. I don't know in full detail what is going on with FullForm or InputForm but I will venture to ...
9 votes

Is there a command that does exact numerical conversion of non-exact to exact numbers?

However, the only method I've found that ensures numerically exact conversion is the manual one: delete the decimal point, and then divide by 10^z, where z is the number of digits to the right of the ...
Szabolcs's user avatar
  • 234k
9 votes
Accepted

Convert decimal value to hexadecimal

Try this IntegerString[62343, 16] // ToUpperCase
user57467's user avatar
  • 2,488
8 votes
Accepted

Why 2^^1*^k does not work?

The number entry form base^^digits is only valid for explicit [0-9] digits in the place of both base and digits. You cannot write literal b^^1001 and then attempt ...
Mr.Wizard's user avatar
  • 271k
8 votes
Accepted

How to copy formatted numbers as MathML without quotation marks?

Original answer The reason for getting extra quotes is that these extra quotes are explicitly present in the box form of the expression generated by such functions as ...
Alexey Popkov's user avatar
8 votes
Accepted

How to format a number with an error?

Update This seems to do what you want a bit more simply than your own solution. ...
Mr.Wizard's user avatar
  • 271k
8 votes
Accepted

Representation of Rational Numbers

Rational is for exact numeric values, not symbolic expressions, i.e. its arguments must be integers. Rational[x,y] is ...
Mr.Wizard's user avatar
  • 271k
8 votes
Accepted

Number of digits problem

The presence of 0.5 in the iterator makes Table use machine-precision numbers for i, which ...
eyorble's user avatar
  • 9,373
8 votes

Making the number 12345...n

Without using IntegerDigits or string processing: ...
flinty's user avatar
  • 24.7k
7 votes

How to get exact Rationalize of a decimal number?

When you simply input 0.97646105481464028, you do not get this number internally: 0.97646105481464028 // FullForm ...
Alexey Popkov's user avatar
7 votes

Unexpected Indeterminate result from evaluating a limit

Mathematica Limit[((h + x)^(1/4) - ( x)^(1/4))/((h + x)^(1/2) - ( x)^(1/2)),h -> 0] (*1/(2 x^(1/4))*) evaluates the limit without problems
Ulrich Neumann's user avatar
7 votes

How to make the Ticks larger?

Ticks -> Details ...
kglr's user avatar
  • 392k
7 votes
Accepted

How to determine the unique combination of digits satisfying a given relation?

Maybe this? ...
lericr's user avatar
  • 26.3k
6 votes

How to format a number with an error?

...
corey979's user avatar
  • 23.9k
6 votes
Accepted

How do I get Mathematica to write the coefficients of polynomial as fractions rather than decimal expansions?

You can use the WorkingPrecision option of LinearModelFit: ...
Carl Woll's user avatar
  • 130k
6 votes

Test if number represents an integer

on suggestion of @george2079 checkInteger[num_] := (# === 0. || # === 0) &@FractionalPart[num]
Ali Hashmi's user avatar
  • 8,940
6 votes
Accepted

Rounding a number to decimal places and keeping a trailing zero

This may mostly do what you want. With num specifying the number you are rounding and prec specifying the number of digits past ...
Bill Watts's user avatar
  • 8,167
6 votes
Accepted

Scientific notation for exact numbers?

You can try $Post or $PrePrint: $Post ...
kglr's user avatar
  • 392k

Only top scored, non community-wiki answers of a minimum length are eligible