Most efficient implementation of a large number class

前端 未结 5 912
情歌与酒
情歌与酒 2020-12-02 00:33

When doing calculations on very large numbers where integral data types such as double or int64 falls short, a separate class to handle such large numbers may be needed.

5条回答
  •  粉色の甜心
    2020-12-02 01:16

    Using the built-in features of a language work for me.

    Java has BigInteger and BigDecimal, and Python automagicaly switches to an object similar to Java's if a number gets out of the range of an integer or whatnot.

    As for other languages though, I have no idea.

    I hate re-inventing the wheel.

提交回复
热议问题