-3

Is there a way to reduce the number of figures of a number?

Example:

double d = 222222222222222224444444444444.0

I want to "serialize" it like 17[2]13[4] for example.

The idea is to reduce the number of "chars" used by the number.

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
Florian
  • 4,507
  • 10
  • 53
  • 73

1 Answers1

1

double d = 222222222222222224444444444444.0

You can't have a double that big in the first place.

I want to "serialize" it like 17[2]13[4] for example. The idea is to reduce the number of "chars" used by the number.

A double only takes 8 bytes regardless of its value. There doesn't seem to be any actual point to this.

user207421
  • 305,947
  • 44
  • 307
  • 483