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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib/] [newlib/] [libc/] [stdlib/] [__ten_mu.c] - Blame information for rev 39

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

Line No. Rev Author Line
1 39 lampret
/*
2
 * [atw] multiply 64 bit accumulator by 10 and add digit.
3
 * The KA/CA way to do this should be to use
4
 * a 64-bit integer internally and use "adjust" to
5
 * convert it to float at the end of processing.
6
 */
7
 
8
#include <_ansi.h>
9
 
10
int
11
_DEFUN (__ten_mul, (acc, digit),
12
        double *acc _AND
13
        int digit)
14
{
15
  /*
16
   * [atw] Crude, but effective (at least on a KB)...
17
   */
18
 
19
  *acc *= 10;
20
  *acc += digit;
21
 
22
  return 0;                      /* no overflow */
23
}

powered by: WebSVN 2.1.0

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