开发者

How to name functions to extract parts of a decimal number?

I am writing a class for handling decimal numbers, e.g. "123.456". I want one function for extracting the digits before the decimal point (123), and one function to extract the digits after the decimal point (0.456). My question is not how to do the programming, but how to name the functions? Do you have any better idea than digits_before_poi开发者_Python百科nt() and digits_after_point()?


integralPart() and decimalPart() or integers() and decimals()


How about integral_part and decimal_part?


integer_part() and fraction_part()

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜