File: arb.h

package info (click to toggle)
polyml 5.7.1-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 40,616 kB
  • sloc: cpp: 44,142; ansic: 26,963; sh: 22,002; asm: 13,486; makefile: 602; exp: 525; python: 253; awk: 91
file content (76 lines) | stat: -rw-r--r-- 2,857 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
    Title:  arb.h - exports signature for arb.c

    Copyright (c) 2000
        Cambridge University Technical Services Limited

    Further modification Copyright 2015-16 David C. J. Matthews

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License version 2.1 as published by the Free Software Foundation.
    
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.
    
    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

*/

#ifndef ARB_H_INCLUDED
#define ARB_H_INCLUDED

class SaveVecEntry;
typedef SaveVecEntry *Handle;
class TaskData; 

// These functions create values of type int from signed or unsigned values.
extern Handle Make_arbitrary_precision(TaskData *taskData, long);
extern Handle Make_arbitrary_precision(TaskData *taskData, unsigned long);

extern Handle Make_arbitrary_precision(TaskData *taskData, int);
extern Handle Make_arbitrary_precision(TaskData *taskData, unsigned);

#ifdef HAVE_LONG_LONG
extern Handle Make_arbitrary_precision(TaskData *taskData, long long);
extern Handle Make_arbitrary_precision(TaskData *taskData, unsigned long long);
#endif

extern Handle Make_arb_from_32bit_pair(TaskData *taskData, uint32_t hi, uint32_t lo);
extern Handle Make_arb_from_pair_scaled(TaskData *taskData, unsigned hi, unsigned lo, unsigned scale);

#if defined(_WIN32)
extern Handle Make_arb_from_Filetime(TaskData *taskData, const FILETIME &ft);
#endif

// This is currently used in the interpreter.
extern Handle mult_longc(TaskData *taskData, Handle,Handle);
// Currently used in basicio.cpp
extern Handle div_longc(TaskData *taskData, Handle,Handle);
extern Handle rem_longc(TaskData *taskData, Handle,Handle);

// Return a uintptr_t/intptr_t value.
extern POLYUNSIGNED     getPolyUnsigned(TaskData *taskData, PolyWord);
extern POLYSIGNED       getPolySigned(TaskData *taskData, PolyWord);

#define get_C_ulong     getPolyUnsigned
extern unsigned short   get_C_ushort(TaskData *taskData, PolyWord);
extern unsigned         get_C_unsigned(TaskData *taskData, PolyWord);

#define get_C_long      getPolySigned
extern short            get_C_short(TaskData *taskData, PolyWord);
extern int              get_C_int(TaskData *taskData, PolyWord);

extern double           get_arbitrary_precision_as_real(PolyWord x);

#if defined(_WIN32)
void getFileTimeFromArb(TaskData *taskData, Handle numHandle, PFILETIME ft);
#endif

extern struct _entrypts arbitraryPrecisionEPT[];

#endif