source: trunk/libs/newlib/src/newlib/libc/stdlib/__ten_mu.c @ 543

Last change on this file since 543 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 422 bytes
Line 
1/*
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#include "std.h"
10
11int
12__ten_mul (double *acc,
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}
Note: See TracBrowser for help on using the repository browser.