I am making a program about the formula 10^(a-1)-1 mod a = 0. However, when using Javascript, it doesn't work with numbers for a above 23. Example:
var b = 29
var a = Math.pow(10, b-1)
console.log(a);
console.log(a/b);
console.log(a % b)
This is the output:
1e+28
3.448275862068965e+26
14
The output for the modulo function should be 1. Is there any way to make it solve the calculations correctly?