OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgo/] [go/] [syscall/] [str.go] - Blame information for rev 756

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 747 jeremybenn
// Copyright 2009 The Go Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style
3
// license that can be found in the LICENSE file.
4
 
5
package syscall
6
 
7
func itoa(val int) string { // do it here rather than with fmt to avoid dependency
8
        if val < 0 {
9
                return "-" + itoa(-val)
10
        }
11
        var buf [32]byte // big enough for int64
12
        i := len(buf) - 1
13
        for val >= 10 {
14
                buf[i] = byte(val%10 + '0')
15
                i--
16
                val /= 10
17
        }
18
        buf[i] = byte(val + '0')
19
        return string(buf[i:])
20
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.