Marius Vollmer
ecc9f40fe5
* hashtab.h: Bugfix: use SCM_API (WAS: extern).
...
* socket.c: Remove obsolete comment about socklen_t.
(s_scm_setsockopt)[!HAVE_IP_MREQ]: Do not use ip_mreq code.
* numbers.h (isnan)[__MINGW32__]: Remove.
* Makefile.am (gen_scmconfig_SOURCES): Bugfix: Add
DEFAULT_INCLUDES when cross compiling.
* threads.c (ETIMEDOUT, pipe)[__MINGW32__]: Add defines.
* stime.c (s_scm_strftime)[!HAVE_TM_ZONE]: Use
SCM_SIMPLE_VECTOR_REF instead of SCM_VELTS. (Changed slightly
from Jan's patch.)
2005-06-05 18:27:53 +00:00
Marius Vollmer
92205699d0
The FSF has a new address.
2005-05-23 19:57:22 +00:00
Kevin Ryde
40882e3d0b
(scm_oneplus, scm_oneminus): New functions, converted from
...
scheme code in boot-9.scm.
2005-04-14 00:35:50 +00:00
Kevin Ryde
23c3b605b5
(scm_i_clonebig): Remove static, so can use in srfi-60.
2005-03-13 00:18:34 +00:00
Marius Vollmer
7a1aba42cf
(scm_i_print_complex, icmplx2str): New.
...
(iflo2str): Use icmplx2str for complex numbers.
2004-10-29 14:17:20 +00:00
Marius Vollmer
b479fe9ae4
(scm_i_print_double): New.
2004-10-26 16:53:23 +00:00
Marius Vollmer
2881e77b5a
(SCM_T_INTBUFLEN): Increased to cover
...
scm_t_intmax values.
(scm_uint2str): New, for scm_t_uintmax.
(scm_iint2str): Argument type changed to scm_t_intmax,
reimplemented in terms of scm_uint2str.
2004-10-22 13:50:39 +00:00
Marius Vollmer
cd0362604b
Include <gmp.h> in numbers.h, not in
...
numbers.c.
(scm_to_mpz, scm_from_mpz): New.
Thanks to Andreas Vögele!
2004-09-21 00:42:30 +00:00
Marius Vollmer
3101f40f76
(scm_round, scm_truncate): Renamed to scm_c_round and scm_c_truncate;
...
deprecated versions installed in deprecated.h and deprecated.c.
Changed all uses.
2004-08-09 23:32:14 +00:00
Marius Vollmer
8507ec804f
(scm_complex_p): New, export as "complex?" to Scheme.
...
(scm_number_p): Export as "number?" to Scheme.
(scm_is_complex, scm_is_number): New.
(scm_c_make_rectangular, scm_c_make_polar): New.
(scm_make_rectangular, scm_make_polar): Use above.
(scm_c_real_part, scm_c_imag_part, scm_c_magnitude, scm_c_angle):
New.
(scm_make_complex): Discouraged by moving to discouraged.h and
discouraged.c. Replaced all uses with scm_c_make_rectangular.
2004-08-03 17:12:14 +00:00
Marius Vollmer
cba42c9344
* numbers.h. numbers.c (scm_make_ratio): Renamed to
...
scm_i_make_ratio and made static, replaced uses with scm_divide.
2004-08-03 15:55:42 +00:00
Marius Vollmer
55f26379b3
(scm_is_rational): New.
...
(scm_i_short2big, scm_i_int2big, scm_i_uint2big, scm_i_size2big,
scm_i_ptrdiff2big, scm_i_long_long2big, scm_i_ulong_long2big):
Removed prototypes.
(scm_make_real, scm_num2dbl, scm_float2num, scm_double2num):
Discouraged by moving to discouraged.h and discouraged.c.
Replaced all uses with scm_from_double.
(scm_num2float, scm_num2double): Discouraged by moving prototype
to discouraged.h and rewriting in terms of scm_to_double.
Replaced all uses with scm_to_double.
(scm_to_double): Do not implement in terms of scm_num2dbl, use
explicit code.
(scm_from_double): Do not implement in terms of scm_make_real, use
explicit code.
2004-08-03 15:03:35 +00:00
Marius Vollmer
c71b07063e
* discouraged.h, discouraged.c: New files.
...
* deprecated.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOLP, SCM_EQ_P,
SCM_NEGATE_BOOL, SCM_BOOL, SCM_BOOT_NOT): Promoted from being
deprecated to being discouraged by moving to discouraged.h.
* numbers.h, numbers.c, discouraged.h, discouraged.c
(scm_short2num, scm_ushort2num, scm_int2num, scm_uint2num,
scm_long2num, scm_ulong2num, scm_size2num, scm_ptrdiff2num,
scm_num2short, scm_num2ushort, scm_num2int, scm_num2uint,
scm_num2long, scm_num2ulong, scm_num2size, scm_num2ptrdiff,
scm_long_long2num, scm_ulong_long2num, scm_num2long_long,
scm_num2ulong_long): Discouraged by moving to discouraged.h and
discouraged.c and reimplementing in terms of scm_from_* and
scm_to_*.
* numbers.h, numbers.c: Removed GUILE_DEBUG code.
(scm_i_short2big, scm_i_ushort2big, scm_i_int2big, scm_i_uint2big,
scm_i_size2big, scm_i_ptrdiff2big): Removed.
(scm_i_long2big, scm_i_ulong2big): New, explicit definitions.
* conv-integer.i.c, conv-uinteger.i.c: Use them instead of
explicit code.
2004-08-02 15:57:04 +00:00
Marius Vollmer
d1b5b4001e
* numbers.h (scm_to_schar, scm_to_uchar, scm_to_char,
...
scm_to_short, scm_to_ushort, scm_to_int, scm_to_uint, scm_to_long,
scm_to_ulong, scm_to_long_long, scm_to_ulong_long, scm_to_intmax,
scm_to_uintmax, scm_to_size_t, scm_to_ssize_t scm_from_schar,
scm_from_uchar, scm_from_char, scm_from_short, scm_from_ushort,
scm_from_int, scm_from_uint, scm_from_long, scm_from_ulong,
scm_from_long_long, scm_from_ulong_long, scm_from_intmax,
scm_from_uintmax, scm_from_size_t, scm_from_ssize_t): No longer
defined in terms of scm_to_signed_integer, etc, but in terms of
scm_to_int8, etc.
2004-07-29 15:48:44 +00:00
Marius Vollmer
bfd7932e66
* conv-integer.i.c, conv-uinteger.i.c: New files, used to generate
...
the functions below.
* numbers.c, numbers.h (scm_to_int8, scm_to_uint8, scm_to_int16,
scm_to_uint16, scm_to_int32, scm_to_uint32, scm_to_int64,
scm_to_uint64, scm_from_int8, scm_from_uint8, scm_from_int16,
scm_from_uint16, scm_from_int32, scm_from_uint32, scm_from_int64,
scm_from_uint64): Turned from macros into proper functions.
(scm_to_signed_integer, scm_to_unsigned_integer,
scm_from_signed_integer, scm_from_unsigned_integer): Generate via
conv-integer.i.c and conv-uinteger.i.c, as well.
2004-07-29 13:42:50 +00:00
Marius Vollmer
3aa13a0579
(SCM_INUMP, SCM_NINUMP, SCM_INUM): Deprecated by reenaming them to
...
SCM_I_INUMP, SCM_I_NINUMP and SCM_I_INUM, respectively and adding
deprecated versions to deprecated.h and deprecated.c. Changed all
uses to either use the SCM_I_ variants or scm_is_*, scm_to_*, or
scm_from_*, as appropriate.
2004-07-23 15:29:27 +00:00
Marius Vollmer
5a572ca13c
* numbers.h (SCM_MAKINUM, SCM_I_MAKINUM): Renamed SCM_MAKINUM to
...
SCM_I_MAKINUM and changed all uses.
* deprecated.h, deprecated.c (SCM_MAKINUM): Newly deprecated.
2004-07-08 15:41:48 +00:00
Marius Vollmer
22008a7804
(scm_to_short, scm_to_ushort): It's SHRT_MIN, etc, not SHORT_MIN.
...
(scm_to_size_t): Use SIZE_MAX instead of cooking our own.
(scm_to_long_long, scm_to_ulong_long, scm_to_int8, scm_to_uint8,
scm_to_int16, scm_to_uint16, scm_to_int32, scm_to_uint32,
scm_to_int64, scm_to_uint64, scm_to_intmax, scm_to_uintmax,
scm_from_long_long, scm_from_ulong_long, scm_from_int8,
scm_from_uint8, scm_from_int16, scm_from_uint16, scm_from_int32,
scm_from_uint32, scm_from_int64, scm_from_uint64, scm_from_intmax,
scm_from_uintmax): New.
2004-07-07 15:22:56 +00:00
Marius Vollmer
73e4de09b9
(scm_is_integer, scm_is_signed_integer, scm_is_unsigned_integer,
...
scm_to_signed_integer, scm_to_unsigned_integer, scm_to_schar,
scm_to_uchar, scm_to_char, scm_to_short, scm_to_ushort, scm_to_long,
scm_to_ulong, scm_to_size_t, scm_to_ssize_t, scm_from_schar,
scm_from_uchar, scm_from_char, scm_from_short, scm_from_ushort,
scm_from_int, scm_from_uint, scm_from_long, scm_from_ulong,
scm_from_size_t, scm_from_ssize_t, scm_is_real, scm_to_double,
scm_from_double): New.
* deprecated.h, boolean.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOL,
SCM_NEGATE_BOOL, SCM_BOOLP): Deprecated by moving into "deprecated.h".
Replaced all uses with scm_is_false, scm_is_true, scm_from_bool, and
scm_is_bool, respectively.
2004-07-06 10:23:30 +00:00
Dirk Herrmann
651f07f82e
* numbers.h (SCM_SLOPPY_FRACTIONP): Removed. It was not used
...
throughout guile, has not been part of an official release yet,
and the concept of sloppy predicates has never been a good idea.
(SCM_FRACTION_NUMERATOR, SCM_FRACTION_DENOMINATOR,
SCM_FRACTION_SET_NUMERATOR, SCM_FRACTION_SET_DENOMINATOR):
Simplified.
2004-05-15 15:50:24 +00:00
Marius Vollmer
fba8fdc0d3
(SCM_I_BIG_MPZ): Use SCM_CELL_OBJECT_LOC instead of taking the address
...
of SCM_CELL_WORD_1, the latter being no longer an lvalue.
2004-05-06 16:42:07 +00:00
Kevin Ryde
d885e204fd
(scm_modulo_expt): Renamed from
...
scm_modular_expt, matching scheme level name `modulo-expt'.
2004-03-25 21:55:20 +00:00
Kevin Ryde
32c9168774
Add copyright years based on ChangeLog entries.
2004-03-25 21:38:59 +00:00
Kevin Ryde
518b750845
2004-03-26 Eric Hanchrow <offby1@blarg.net>
...
* numbers.c, numbers.h (scm_modular_expt): New function.
2004-03-25 21:35:53 +00:00
Marius Vollmer
f92e85f735
* print.c (scm_iprin1): Handle fractions.
...
* objects.h (scm_class_fraction): New.
* objects.c (scm_class_fraction): New.
(scm_class_of): Handle fractions.
* hash.c (scm_hasher): Handle fractions.
* numbers.c: New code for handling fraction all over the place.
(scm_odd_p, scm_even_p): Handle inexact integers.
(scm_rational_p): New function, same as scm_real_p.
(scm_round_number, scm_truncate_number, scm_ceiling, scm_floor):
New exact functions that replace the inexact 'dsubr'
implementations.
(scm_numerator, scm_denominator): New.
* numbers.h (SCM_NUMP): Recognize fractions.
(SCM_FRACTIONP, SCM_SLOPPY_FRACTIONP, SCM_FRACTION_NUMERATOR,
SCM_FRACTION_DENOMINATOR, SCM_FRACTION_SET_NUMERATOR,
SCM_FRACTION_SET_DENOMINATOR, SCM_FRACTION_REDUCED_BIT,
SCM_FRACTION_REDUCED_SET, SCM_FRACTION_REDUCED_CLEAR,
SCM_FRACTION_REDUCED): New.
(scm_floor, scm_ceiling, scm_truncate_number, scm_round_number):
New prototypes.
(scm_make_ratio, scm_rationalize, scm_numerator, scm_denominator,
scm_rational_p): New prototypes.
(scm_i_dbl2num, scm_i_fraction2double, scm_i_fraction_equalp,
scm_i_print_fraction): New prototypes.
* goops.c (create_standard_classes): Create "<fraction>" class.
* gc-mark.c (scm_gc_mark_dependencies): Handle fractions.
* gc-card.c (scm_i_sweep_card): Include scm_tc16_fraction as a
case in the switch, but do nothing for now.
* eval.c (SCM_CEVAL, SCM_APPLY, call_dsubr_1): Convert fractions
to doubles when calling 'dsubr' functions.
* eq.c (scm_eqv_p, scm_equal_p): Handle fractions.
2003-11-18 19:59:53 +00:00
Dirk Herrmann
f03314f920
* numbers.h (SCM_INEXACTP): Removed uses of SCM_TYP16S.
...
* tags.h, deprecated.h (SCM_TYP16S): Deprecated and moved from
tags.h to deprecated.h.
2003-09-21 07:54:23 +00:00
Dirk Herrmann
534c55a97d
This set of patches introduces a new tc7 code scm_tc7_number for
...
numbers. Bignums, reals and complex numbers are turned from smobs
into subtypes of scm_tc7_number.
* tags.h (scm_tc7_number): New.
* eq.c (scm_equal_p), eval.c (SCM_CEVAL), evalext.c
(scm_self_evaluating_p), gc-card.c (scm_i_sweep_card), gc-mark.c
(scm_gc_mark_dependencies), goops.c (create_smob_classes), hash.c
(scm_hasher), numbers.c, numbers.h (SCM_NUMP), objects.c
(scm_class_of), print.c (scm_iprin1), smob.c
(scm_smob_prehistory): Don't handle bignums, reals and complex
numbers as subtypes of scm_tc7_smob any more.
* numbers.h, tags.h (scm_tc16_big, scm_tc16_real,
scm_tc16_complex): Moved definitions from tags.h to numbers.h.
2003-09-18 20:55:40 +00:00
Dirk Herrmann
0d5e348022
* numbers.h (SCM_INEXACTP, SCM_REALP, SCM_COMPLEXP): Removed uses
...
of SCM_SLOPPY_INEXACTP, SCM_SLOPPY_REALP and SCM_SLOPPY_COMPLEXP.
* numbers.h, deprecated.h (SCM_SLOPPY_INEXACTP, SCM_SLOPPY_REALP,
SCM_SLOPPY_COMPLEXP): Deprecated and moved from numbers.h to
deprecated.h.
2003-09-06 09:17:29 +00:00
Dirk Herrmann
5d7d39ff5d
* numbers.h (SCM_MAKINUM): Define in terms of scm_tc2_int.
...
(SCM_INEXACTP, SCM_REALP, SCM_COMPLEXP): Define in terms of the
respective SLOPPY macro.
2003-09-04 20:04:30 +00:00
Stefan Jahn
1e498fbd0f
2003-05-30 Stefan Jahn <stefan@lkcc.org>
...
* configure.in: Checking for unsetenv().
2003-05-30 Stefan Jahn <stefan@lkcc.org>
* posix.c (s_scm_putenv): Use the new HAVE_UNSETENV
appropriately for mingw32 hosts.
* numbers.h: Defining copysign(), isnan() and finite() to
be prefixed by a single '_' for mingw32 hosts.
2003-05-30 09:39:34 +00:00
Rob Browning
0b85efff1d
oops -- reverse accidental commit.
2003-04-16 19:45:12 +00:00
Rob Browning
3b8b889c93
*** empty log message ***
2003-04-16 19:45:11 +00:00
Rob Browning
5384438984
* numbers.h: remove the gmp.h #include (not needed now).
2003-04-07 01:50:35 +00:00
Marius Vollmer
73be1d9e8e
Changed license terms to the plain LGPL thru-out.
2003-04-05 19:15:35 +00:00
Rob Browning
d3e7e88dcb
* numbers.h: remove SCM_BIGDIG conditionals, reorganize, and
...
rewrite to handle GMP bignums.
2003-04-04 21:49:55 +00:00
Rob Browning
f0ad7455ec
* numbers.h: fix various preprocessor usages of new public
...
symbols to expect 0 or 1 values rather than 1 or undefined.
i.e. change #ifdef to #if, etc.
2003-03-27 20:09:18 +00:00
Rob Browning
22185d5f65
* numbers.h: replace usage of HAVE_FLOATINGPOINT_H with
...
SCM_HAVE_FLOATINGPOINT_H. Replace usage of HAVE_IEEEFP_H with
SCM_HAVE_IEEEFP_H. Replace usage of HAVE_NAN_H with
SCM_HAVE_NAN_H. Replace usage of STDC_HEADERS with
SCM_HAVE_STDC_HEADERS. Replace usage of ptrdiff_t with
scm_t_ptrdiff. Replace usage of HAVE_LONG_LONGS with
"SCM_SIZEOF_LONG_LONG != 0".
2003-03-25 23:57:58 +00:00
Marius Vollmer
232898d93d
Conditionally include floatingpoint.h, ieeefp.h, and nan.h. Provide
...
declarations for scm_inf_p, scm_nan_p, scn_inf, and scm_nan.
2002-05-06 22:27:42 +00:00
Marius Vollmer
760eb0ce25
(SCM_MAKE_BIGNUM_TAG): New.
2001-11-25 15:12:39 +00:00
Stefan Jahn
b4e15479e9
2001-11-07 Stefan Jahn <stefan@lkcc.org>
...
* configure.in: Include `win32-socket.o' in the list of object
files if networking is enabled on Win32.
2001-11-07 Stefan Jahn <stefan@lkcc.org>
* win32-socket.[ch]: New files. Defines Winsock-API error codes
and makes them available through Guile. That is because the
Winsock-API does not store its errors in `errno' and thus cannot
return error messages via `strerror (errno)'.
* socket.c (scm_init_socket): Initialize `win32-socket' part
here under M$-Windows.
* numbers.h: Added missing declaration of
`scm_sys_check_number_conversions()'.
* error.c: Local definition of SCM_I_STRERROR and SCM_I_ERRNO
and use in `(strerror)' and `(system-error)'.
* Makefile.am (EXTRA_libguile_la_SOURCES): Added
`win32-socket.[ch]' to extra source and header files.
2001-11-07 15:08:45 +00:00
Marius Vollmer
33b001fd89
Prefixed each each exported symbol with SCM_API.
2001-11-02 00:19:12 +00:00
Marius Vollmer
c0060c9589
Corrected definition of SCM_MOST_POSITIVE_FIXNUM. Boy was I confused.
2001-10-06 20:48:27 +00:00
Marius Vollmer
004c0902ff
* tags.h (SCM_T_BITS_MAX, SCM_T_SIGNED_BITS_MAX,
...
SCM_T_SIGNED_BITS_MIN): New.
* numbers.h (SCM_MOST_POSITIVE_FIXNUM, SCM_MOST_NEGATIVE_FIXNUM):
Use them to make these macros computable by the preprocessor.
2001-10-06 19:58:02 +00:00
Dirk Herrmann
14282d0f5c
* numbers.h: Removed old comment about using SCM_CAR to access
...
non-pair cells.
(SCM_MOST_POSITIVE_FIXNUM, SCM_MOST_NEGATIVE_FIXNUM): Make sure
the return value is signed. Thanks to Brian Crowder for the bug
report.
(SCM_SRS): Avoid unnecessary casting and don't unpack input
values. With this patch, SCM_SRS can be safely used for other
types than scm_t_signed_bits. However, it should still better be
an internal macro and thus be renamed to SCM_I_SRS.
(SCM_MAKINUM, SCM_INUM): Use proper casting.
2001-10-05 17:43:49 +00:00
Mikael Djurfeldt
581ded70a3
* validate.h (SCM_NUM2FLOAT, SCM_NUM2DOUBLE,
...
SCM_VALIDATE_FLOAT_COPY, SCM_VALIDATE_DOUBLE_COPY): New
macros. (The NUM names might soon change.)
* numbers.h: Added missing declarations.
2001-09-23 21:25:26 +00:00
Dirk Herrmann
dee01b012c
* Removed deprecated stuff.
...
* Some more renamings to SCM_<filename>_H.
2001-08-31 12:13:50 +00:00
Dirk Herrmann
3c9a524f01
* Rewrote string->number stuff.
2001-07-30 19:35:15 +00:00
Thien-Thi Nguyen
a06e3a75b2
Remove "face-lift" comment.
2001-07-09 07:36:48 +00:00
Marius Vollmer
92c2555f69
replace "scm_*_t" with "scm_t_*".
2001-06-14 19:50:43 +00:00
Marius Vollmer
4d87842bb3
(SCM_SRS): Cast shiftee to scm_signed_bits_t.
...
(SCM_INUM): Cast result to scm_signed_bits_t.
2001-06-14 17:41:21 +00:00