Re: Reg: Proposal: Generalized Number.parseNumber(String) Method for Java

2025-04-05 Thread Sathish Kumar Thiyagarajan
e, Apr 1, 2025 at 7:58 AM Sathish Kumar Thiyagarajan < > sathishkumar.thiyagara...@gmail.com> wrote: > >> However, *Jackson (and most JSON parsers) default to Integer for whole >> numbers* because they rely on Integer.parseInt(String), which is a safe >> fallback for mo

Re: Reg: Proposal: Generalized Number.parseNumber(String) Method for Java

2025-04-01 Thread Sathish Kumar Thiyagarajan
Number(String)` in the `testNumberMemoryUsage()` method. > Example: *"I have this test method verifying this behavior of that > application. Given a `Number#parseNumber(String)`, I can improve this as > follows."* > > On Fri, Mar 28, 2025 at 6:31 PM Sathish Kumar Thiyagaraj

Re: Reg: Proposal: Generalized Number.parseNumber(String) Method for Java

2025-03-28 Thread Sathish Kumar Thiyagarajan
class that provides > frequently needed conversions and optimizations? Would love to hear your thoughts on whether such an approach would be useful and where it might fit within the broader discussion around numeric types in Java. Best regards, Sathish Kumar Thiyagarajan On Sat, 29 Mar 2025 at

Reg: Proposal: Generalized Number.parseNumber(String) Method for Java

2025-03-28 Thread Sathish Kumar Thiyagarajan
ls BigDecimal bd = new BigDecimal(numberStr); try { // Convert to BigInteger if there's no fraction return bd.toBigIntegerExact(); } catch (ArithmeticException ex) { return bd; // If it's a decimal, return BigDecimal }