Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That'd be awesome!

    diff --git a/src/strconv/atof.go b/src/strconv/atof.go
    index 28ad094..49cec69 100644
    --- a/src/strconv/atof.go
    +++ b/src/strconv/atof.go
    @@ -410,12 +410,12 @@ out:
     }
     
     // Exact powers of 10.
    -var float64pow10 = []float64{
    +var float64pow10 = [...]float64{
      1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9,
      1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19,
      1e20, 1e21, 1e22,
     }
    -var float32pow10 = []float32{1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10}
    +var float32pow10 = [...]float32{1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10}
     
     // If possible to convert decimal representation to 64-bit float f exactly,
     // entirely in floating-point math, do so, avoiding the expense of decimalToFloatBits.

math.Pow10() already uses arrays this way, and I found a ~10% performance while optimizing an alternative float parsing implementation by making the same change.


I just want to say kudos and well done to post the diff here.


Didn't you just poison this change and ensure that it can never be applied? Having posted this anonymously, nobody can sign the Contributor License Agreement and promise truthfully that this is original code that they have the rights to contribute. Including yourself, in the future.


You can not copyright the ... (dot dot dot) nor can you claim copyright to an existing work by adding ... to it. You might be able to pattern it though...


I don't know the specifics of Google's contributor agreement (you need to log in with a Google account just to read it), but in my experience they are much stricter than copyright law. I've heard of organizations that would like to force people to sign contributor agreements just to be allowed to open GitHub issues. Because the issue might contain information that might taint everything. At least in the view of corporate lawyers.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: