summaryrefslogtreecommitdiff
path: root/libguile/sort.c
Commit message (Expand)AuthorAgeFilesLines
* Support typed arrays in some sort functions...* libguile/sort.c (sort!, sort, restricted-vector-sort!, sorted?): Support arrays of rank 1, whatever the type. * libguile/quicksort.i.c: Fix accessors to handle typed arrays. * test-suite/tests/sort.test: Test also with typed arrays. Daniel Llorens2016-11-231-42/+89
* Change uses of scm_is_simple_vector to scm_is_vector...* libguile/filesys.c, libguile/random.c, libguile/stime.c, libguile/trees.c, libguile/validate.h: use scm_is_vector instead of scm_is_simple_vector. * libguile/sort.c (scm_sort_x, scm_sort, scm_stable_sort_x) (scm_stable_sort): Remove scm_is_vector check; scm_is_array is sufficient. * test-suite/tests/arrays.test: Fix header. * test-suite/tests/random.test: New coverage test covering random:normal-vector!. * test-suite/Makefile.am: Include random.test in make check. Daniel Llorens2014-02-081-11/+5
* Deprecate the use of the vector interface on arrays...* libguile/vectors.c (scm_is_vector): Deprecate use on weak vectors and arrays. (scm_is_simple_vector): Deprecate use on weak vectors. (scm_vector_length, scm_c_vector_ref, scm_c_vector_set_x): Deprecate use on arrays. * libguile/sort.c: Adapt to check explicitly for arrays. Andy Wingo2014-02-081-6/+10
* Fix and clarify documentation of `sorted?'....Fixed <http://bugs.gnu.org/11262>. Reported by Alexei Matveev <alexei.matveev@gmail.com>. * libguile/sort.c (scm_sorted_p): Fix and clarify docstring. * doc/ref/api-utility.texi (Sorting): Update accordingly. Ludovic Courtès2012-04-221-4/+7
* Fix likely crash in `stable-sort!'...* libguile/sort.c (scm_stable_sort_x): Properly handle zero-length vectors. * test-suite/tests/sort.test ("stable-sort"): Add test for this case. Andreas Rottmann2011-06-091-1/+6
* remove libguile/lang.h, deprecate %nil (in favor of #nil)...* libguile/Makefile.am: * libguile/init.c: * libguile/lang.c: * libguile/lang.h: Remove lang.c and lang.h. * libguile/pairs.h (SCM_NIL_P, SCM_NULL_OR_NIL_P): Moved here. * module/ice-9/deprecated.scm (%nil): %nil definition moved here. * libguile/alist.c: * libguile/async.c: * libguile/backtrace.c: * libguile/boolean.c: * libguile/dynl.c: * libguile/eval.c: * libguile/filesys.c: * libguile/fluids.c: * libguile/list.c: * libguile/load.c: * libguile/options.c: * libguile/posix.c: * libguile/print.c: * libguile/promises.c: * libguile/sort.c: * libguile/throw.c: * libguile/trees.c: * libguile/vectors.c: * libguile/vm.c: * libguile/weaks.c: * srfi/srfi-1.c: <libguile/lang.h> references removed. Andy Wingo2010-04-091-2/+1
* remove uses of trampolines within guile itself...* libguile/eval.c (scm_map, scm_for_each) * libguile/hashtab.c (scm_hash_for_each_handle) * libguile/list.c (scm_filter, scm_filter_x) * libguile/quicksort.i.c: * libguile/sort.c (scm_restricted_vector_sort_x, scm_sorted_p) (scm_merge, scm_merge_list_x, scm_merge_x) (scm_merge_list_step, scm_sort_x, scm_sort, scm_merge_vector_x) (scm_merge_vector_step, scm_stable_sort_x, scm_sort_list_x) (scm_sort_list)nn * libguile/srfi-13.c (scm_string_any, scm_string_every) (scm_string_tabulate, scm_string_trim, string_trim_right) (scm_string_trim_both, scm_string_index, scm_string_index_right) (scm_string_skip, scm_string_skip_right, scm_string_count) (scm_string_map, scm_string_map_x, scm_string_for_each) (scm_string_for_each_index, scm_string_filter, scm_string_delete): Remove uses of trampolines. Andy Wingo2009-12-011-42/+24
* rename unif.[ch] to arrays.[ch]...* libguile/Makefile.am: * libguile/unif.c: * libguile/unif.h: * libguile/arrays.c: * libguile/arrays.h: Rename unif.[ch] to arrays.[ch]. * libguile.h: * libguile/array-handle.c: * libguile/array-map.c: * libguile/bitvectors.c: * libguile/bytevectors.c: * libguile/eq.c: * libguile/gc-card.c: * libguile/gc-malloc.c: * libguile/gc-mark.c: * libguile/gc.c: * libguile/init.c: * libguile/inline.h: * libguile/print.c: * libguile/random.c: * libguile/read.c: * libguile/socket.c: * libguile/sort.c: * libguile/srfi-4.c: * libguile/srfi-4.h: * libguile/strports.c: * libguile/vectors.c: * libguile/vectors.h: Update includers. Andy Wingo2009-07-191-1/+1
* rename ramap.[ch] to array-map.[ch]...* libguile/array-map.c: * libguile/array-map.h: Rename from ramap.c and ramap.h. * libguile.h: * libguile/Makefile.am: * libguile/eq.c: * libguile/init.c: * libguile/sort.c: * libguile/unif.c: * libguile/vectors.c: All referrers changed. Andy Wingo2009-07-191-2/+2
* Change Guile license to LGPLv3+...(Not quite finished, the following will be done tomorrow. module/srfi/*.scm module/rnrs/*.scm module/scripts/*.scm testsuite/*.scm guile-readline/* ) Neil Jerram2009-06-171-6/+7
* Include <config.h> in all C files; use `#ifdef HAVE_CONFIG_H' rather than `#if'.Ludovic Courtès2008-09-131-1/+5
* copyright yearKevin Ryde2007-03-071-1/+1
* merge from 1.8 branchKevin Ryde2007-03-071-0/+3
* merge from 1.8 branchKevin Ryde2006-04-171-1/+1
* The FSF has a new address.Marius Vollmer2005-05-231-1/+1
* (scm_array_handle_release): New, changed all uses of...scm_t_array_handle to properly call it. (scm_vector_get_handle, scm_generalized_vector_get_handle): Renamed former to latter, changed all uses. Marius Vollmer2005-01-061-0/+7
* * sort.c (quicksort): Added INC parameter for non-contigous...vectors. (quicksort1): New, for contigous vectors. Both functions are generated from the same code by including "quicksort.i.c". (scm_restricted_vector_sort_x): Call one of quicksort and quicksort1, depending on increment of vector. (scm_sort): Simply call scm_sort_x on a copy of the list or vector. (scm_merge_vector_x, scm_merge_vector_step): Changed indices to size_t, added inc parameter. (scm_stable_sort_x): Allocate temporary storage as Scheme vector so that it doesn't leak. (scm_stable_sort): Simply call scm_stable_sort_x on a copy of the list or vector. * tags.h, weaks.c, vports.c, hashtab.c, convert.c, sort.c: Use new vector elements API or simple vector API, as appropriate. Removed SCM_HAVE_ARRAYS ifdefery. Replaced all uses of SCM_HASHTABLE_BUCKETS with SCM_HASHTABLE_BUCKET. Marius Vollmer2005-01-021-348/+83
* (quicksort): Don't use C99 variable declarations.Marius Vollmer2004-11-021-5/+4
* (quicksort, scm_merge, scm_merge_list_x,...scm_merge_list_step, scm_merge_vector_step): Inserted SCM_TICKs at strategic places so that the loops can be interrupted. Marius Vollmer2004-10-221-1/+9
* (quicksort): Copy pivot out of the array while constructing the...partitions; it could get overwritten otherwise. Because of the ultimate insertion sort, this bug did not cause quicksort to fail, it just put all the burdon on the insertion sort and was thus very slow. Thanks to Rolan Orre for reporting the slowness! Marius Vollmer2004-10-191-2/+4
* (scm_restricted_vector_sort_x): Validate startpos <= endpos. State...inclusiveness/exclusiveness if bounds in docstring. Marius Vollmer2004-10-191-2/+3
* *** empty log message ***Marius Vollmer2004-09-221-5/+5
* * deprecated.h, deprecated.c, numbers.h (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. Marius Vollmer2004-07-231-4/+4
* * validate.h, deprecated.h (SCM_VALIDATE_INUM, SCM_VALIDATE_INUM_COPY,...SCM_VALIDATE_BIGINT, SCM_VALIDATE_INUM_MIN, SCM_VALIDATE_INUM_MIN_COPY, SCM_VALIDATE_INUM_MIN_DEF_COPY,SCM_VALIDATE_INUM_DEF, SCM_VALIDATE_INUM_DEF_COPY, SCM_VALIDATE_INUM_RANGE, SCM_VALIDATE_INUM_RANGE_COPY): Deprecated because they make the fixnum/bignum distinction visible. Changed all uses to scm_to_size_t or similar. Marius Vollmer2004-07-101-4/+2
* * numbers.h (SCM_MAKINUM, SCM_I_MAKINUM): Renamed SCM_MAKINUM to...SCM_I_MAKINUM and changed all uses. Marius Vollmer2004-07-081-4/+4
* * 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. Marius Vollmer2004-07-061-15/+15
* * sort.c, pairs.h: Removed unnecessary includes.Dirk Herrmann2003-04-231-3/+0
* * test-suite/tests/sort.test: Added. Both tests in that file did... fail (one even with a segfault) with CVS guile before the recent changes to libguile/sort.c. * libguile/sort.c: Replaced hand-made trampline code by the new official mechanism from eval.c. This fixes a segfault in the new test file test-suite/tests/sort.test. (quicksort, compare_function, scm_restricted_vector_sort_x, scm_sorted_p, scm_merge, scm_merge_list_x, scm_merge_x, scm_merge_list_step, scm_sort_x, scm_sort, scm_merge_vector_x, scm_merge_vector_step, scm_stable_sort_x, scm_stable_sort, scm_sort_list_x, scm_sort_list): Use trampoline mechanism from eval.c. (subr2less, lsubrless, closureless, applyless, scm_cmp_function, cmp_fun_t): Removed. (compare_function): Added. * libguile/sort.c (quicksort, SWAP, stack_node): Replaced pointer arithmetics with index arithmetics. Changed quicksort to work on an array of SCM values instead of an array of characters. Avoid bytewise copying of SCM elements. Avoid allocating memory on the stack with alloca. Fixed some comments. Dirk Herrmann2003-04-221-281/+167
* Changed license terms to the plain LGPL thru-out.Marius Vollmer2003-04-051-36/+12
* * sort.c: 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. Rob Browning2003-03-271-2/+2
* * sort.c: #include <config.h> if HAVE_CONFIG_H. Rename usage of...HAVE_ARRAYS to SCM_HAVE_ARRAYS. Rob Browning2003-03-261-2/+7
* * eval.h (scm_t_trampoline_1, scm_t_trampoline_2): New types....* eval.c, eval.h (scm_trampoline_1, scm_trampoline_2): New functions. * eval.c (call_subr2_2, call_lsubr_2, call_closure_2): New functions; (map, for-each): Handle also application on two args as a special case; Use trampolines. * sort.c (scm_cmp_function): Choose subr2less for scm_tc7_subr_2o; (subr2oless): Removed. (scm_restricted_vector_sort_x): Use scm_return_first to keep the vector GC protected. * eval.c (check_map_args): Use scm_out_of_range_pos instead of scm_out_of_range. Mikael Djurfeldt2002-12-011-12/+3
* * mallocs.c (scm_malloc_obj): use scm_gc_malloc in stead of...malloc. * gc-segment.c (scm_i_get_new_heap_segment): remove cluster cruft: only use SCM_MIN_HEAP_SEG_SIZE. * ports.c (scm_add_to_port_table): add backwards compatibility function * ports.h: use scm_i_ prefix for port table and port table size. Han-Wen Nienhuys2002-08-161-2/+2
* * macros.c: include deprecation.h...* vectors.c (s_scm_vector_move_right_x): remove side effect in macro arg. (s_scm_vector_move_left_x): idem. * net_db.c, posix.c, socket.c: variable naming: change ans to result. * sort.c (scm_merge_vector_x): accept vector as argument iso. SCM*. This is needed for full GC correctness. * gc.h: undo previous undocumented changes related to #ifdef GENGC. Han-Wen Nienhuys2002-07-211-43/+45
* 2002-07-20 Han-Wen <hanwen@cs.uu.nl>...* *.c: add space after commas everywhere. * *.c: use SCM_VECTOR_SET everywhere, where a vector is written. Document cases where SCM_WRITABLE_VELTS() is used. * vectors.h (SCM_VELTS): prepare for write barrier, and let SCM_VELTS() return a const pointer (SCM_VECTOR_SET): add macro. * autogen.sh (mscripts): find and check version number of autoconf. Complain if 2.53 is not found. Han-Wen Nienhuys2002-07-201-28/+42
* Retire inclusion guard macro SCM_MAGIC_SNARFER.Thien-Thi Nguyen2002-03-141-2/+0
* * First batch of libguile changes for Elisp support....* Fixed a few typos. * Minor rationalization of macros relating to source breakpoints. Neil Jerram2002-01-221-15/+16
* * procs.h (SCM_CLOSURE_BODY): New Macro....* debug.c (scm_procedure_name, scm_procedure_source), eval.c (SCM_CEVAL, SCM_APPLY), goops.c (scm_sys_initialize_object, get_slot_value, set_slot_value), procs.c (scm_procedure_documentation), sort.c (closureless), stacks.c (get_applybody): Replace SCM_CDR (SCM_CODE (...)) by SCM_CLOSURE_BODY. * sort.c (closureless): Prefer !SCM_FOOP over SCM_NFOOP. Dirk Herrmann2002-01-101-1/+1
* * Adding C function declarations from the SCM interface to the... reference manual documentation. Neil Jerram2001-11-161-3/+4
* Remove "face-lift" comment.Thien-Thi Nguyen2001-07-091-2/+0
* * eval.c (scm_call_0, scm_call_1, scm_call_2, scm_call_3,... scm_apply_0, scm_apply_1, scm_apply_2, scm_apply_3): New functions. Keisuke Nishida2001-06-261-4/+2
* * Changed the default definition of SCM....* Fixed some typing problems detected by the above change. * Fixed some problems that were detected by compiling guile with -W. Dirk Herrmann2001-05-271-2/+2
* revert the ill-considered part of the 2001-05-24 changesMichael Livshin2001-05-261-21/+21
* * validate.h...(SCM_NUM2{SIZE,PTRDIFF,SHORT,USHORT,BITS,UBITS,INT,UINT}[_DEF]): new macros. * unif.h: type renaming: scm_array -> scm_array_t scm_array_dim -> scm_array_dim_t the old names are deprecated, all in-Guile uses changed. * tags.h (scm_ubits_t): new typedef, representing unsigned scm_bits_t. * stacks.h: type renaming: scm_info_frame -> scm_info_frame_t scm_stack -> scm_stack_t the old names are deprecated, all in-Guile uses changed. * srcprop.h: type renaming: scm_srcprops -> scm_srcprops_t scm_srcprops_chunk -> scm_srcprops_chunk_t the old names are deprecated, all in-Guile uses changed. * gsubr.c, procs.c, print.c, ports.c, read.c, rdelim.c, ramap.c, rw.c, smob.c, sort.c, srcprop.c, stacks.c, strings.c, strop.c, strorder.c, strports.c, struct.c, symbols.c, unif.c, values.c, vectors.c, vports.c, weaks.c: various int/size_t -> size_t/scm_bits_t changes. * random.h: type renaming: scm_rstate -> scm_rstate_t scm_rng -> scm_rng_t scm_i_rstate -> scm_i_rstate_t the old names are deprecated, all in-Guile uses changed. * procs.h: type renaming: scm_subr_entry -> scm_subr_entry_t the old name is deprecated, all in-Guile uses changed. * options.h (scm_option_t.val): unsigned long -> scm_bits_t. type renaming: scm_option -> scm_option_t the old name is deprecated, all in-Guile uses changed. * objects.c: various long -> scm_bits_t changes. (scm_i_make_class_object): flags: unsigned long -> scm_ubits_t * numbers.h (SCM_FIXNUM_BIT): deprecated, renamed to SCM_I_FIXNUM_BIT. * num2integral.i.c: new file, multiply included by numbers.c, used to "templatize" the various integral <-> num conversion routines. * numbers.c (scm_mkbig, scm_big2num, scm_adjbig, scm_normbig, scm_copybig, scm_2ulong2big, scm_dbl2big, scm_big2dbl): deprecated. (scm_i_mkbig, scm_i_big2inum, scm_i_adjbig, scm_i_normbig, scm_i_copybig, scm_i_short2big, scm_i_ushort2big, scm_i_int2big, scm_i_uint2big, scm_i_long2big, scm_i_ulong2big, scm_i_bits2big, scm_i_ubits2big, scm_i_size2big, scm_i_ptrdiff2big, scm_i_long_long2big, scm_i_ulong_long2big, scm_i_dbl2big, scm_i_big2dbl, scm_short2num, scm_ushort2num, scm_int2num, scm_uint2num, scm_bits2num, scm_ubits2num, scm_size2num, scm_ptrdiff2num, scm_num2short, scm_num2ushort, scm_num2int, scm_num2uint, scm_num2bits, scm_num2ubits, scm_num2ptrdiff, scm_num2size): new functions. * modules.c (scm_module_reverse_lookup): i, n: int -> scm_bits_t.x * load.c: change int -> size_t in various places (where the variable is used to store a string length). (search-path): call scm_done_free, not scm_done_malloc. * list.c (scm_ilength): return a scm_bits_t, not long. some other {int,long} -> scm_bits_t changes. * hashtab.c: various [u]int -> scm_bits_t changes. scm_ihashx_closure -> scm_ihashx_closure_t (and made a typedef). (scm_ihashx): n: uint -> scm_bits_t use scm_bits2num instead of scm_ulong2num. * gsubr.c: various int -> scm_bits_t changes. * gh_data.c (gh_scm2double): no loss of precision any more. * gh.h (gh_str2scm): len: int -> size_t (gh_{get,set}_substr): start: int -> scm_bits_t, len: int -> size_t (gh_<num>2scm): n: int -> scm_bits_t (gh_*vector_length): return scm_[u]size_t, not unsigned long. (gh_length): return scm_bits_t, not unsigned long. * fports.h: type renaming: scm_fport -> scm_fport_t the old name is deprecated, all in-Guile uses changed. * fports.c (fport_fill_input): count: int -> scm_bits_t (fport_flush): init_size, remaining, count: int -> scm_bits_t * debug.h (scm_lookup_cstr, scm_lookup_soft, scm_evstr): removed those prototypes, as the functions they prototype don't exist. * fports.c (default_buffer_size): int -> size_t (scm_fport_buffer_add): read_size, write_size: int -> scm_bits_t default_size: int -> size_t (scm_setvbuf): csize: int -> scm_bits_t * fluids.c (n_fluids): int -> scm_bits_t (grow_fluids): old_length, i: int -> scm_bits_t (next_fluid_num, scm_fluid_ref, scm_fluid_set_x): n: int -> scm_bits_t (scm_c_with_fluids): flen, vlen: int -> scm_bits_t * filesys.c (s_scm_open_fdes): changed calls to SCM_NUM2LONG to the new and shiny SCM_NUM2INT. * extensions.c: extension -> extension_t (and made a typedef). * eval.h (SCM_IFRAME): cast to scm_bits_t, not int. just so there are no nasty surprises if/when the various deeply magic tag bits move somewhere else. * eval.c: changed the locals used to store results of SCM_IFRAME, scm_ilength and such to be of type scm_bits_t (and not int/long). (iqq): depth, edepth: int -> scm_bits_t (scm_eval_stack): int -> scm_bits_t (SCM_CEVAL): various vars are not scm_bits_t instead of int. (check_map_args, scm_map, scm_for_each): len: long -> scm_bits_t i: int -> scm_bits_t * environments.c: changed the many calls to scm_ulong2num to scm_ubits2num. (import_environment_fold): proc_as_ul: ulong -> scm_ubits_t * dynwind.c (scm_dowinds): delta: long -> scm_bits_t * debug.h: type renaming: scm_debug_info -> scm_debug_info_t scm_debug_frame -> scm_debug_frame_t the old names are deprecated, all in-Guile uses changed. (scm_debug_eframe_size): int -> scm_bits_t * debug.c (scm_init_debug): use scm_c_define instead of the deprecated scm_define. * continuations.h: type renaming: scm_contregs -> scm_contregs_t the old name is deprecated, all in-Guile uses changed. (scm_contregs_t.num_stack_items): size_t -> scm_bits_t (scm_contregs_t.num_stack_items): ulong -> scm_ubits_t * continuations.c (scm_make_continuation): change the type of stack_size form long to scm_bits_t. * ports.h: type renaming: scm_port_rw_active -> scm_port_rw_active_t (and made a typedef) scm_port -> scm_port_t scm_ptob_descriptor -> scm_ptob_descriptor_t the old names are deprecated, all in-Guile uses changed. (scm_port_t.entry): int -> scm_bits_t. (scm_port_t.line_number): int -> long. (scm_port_t.putback_buf_size): int -> size_t. * __scm.h (long_long, ulong_long): deprecated (they pollute the global namespace and have little value besides that). (SCM_BITS_LENGTH): new, is the bit size of scm_bits_t (i.e. of an SCM handle). (ifdef spaghetti): include sys/types.h and sys/stdtypes.h, if they exist (for size_t & ptrdiff_t) (scm_sizet): deprecated. * Makefile.am (noinst_HEADERS): add num2integral.i.c Michael Livshin2001-05-241-21/+21
* * Fixed scm_thunk_p's results when applied to closures....* Extracted macro printing code from print.c to macros.c. * Minor cleanups. Dirk Herrmann2001-04-191-2/+2
* * configure.in: don't append threads.doc to EXTRA_DOT_DOC_FILES,... since EXTRA_DOT_DOC_FILES is redefined later. define EXTRA_DOT_X_FILES and hand it to AC_SUBST. * sort.c (scm_sort): move sortvec variable to avoid a compiler warning when HAVE_ARRAYS is not defined. move len too. * Makefile.am (DOT_X_FILES): remove net_db.x, posix.x, socket.x. (EXTRA_DOT_X_FILES): let configure set the value. (DOT_DOC_FILES): remove net_db.doc, posix.doc, socket.doc. Gary Houston2001-03-171-4/+5
* Remove #include <stdio.h>. Add #include <string.h>.Keisuke Nishida2001-03-091-0/+1
* * Eliminate another couple of calls to scm_wta.Dirk Herrmann2001-03-041-4/+4
* * Added docstrings by Martin Grabmueller.Dirk Herrmann2001-01-301-11/+43
* * alist.c, arbiters.c, async.c, backtrace.c, boolean.c, chars.c,...continuations.c, debug-malloc.c, debug.c, dynl.c, dynwind.c, environments.c, eq.c, error.c, eval.c, evalext.c, feature.c, filesys.c, fluids.c, fports.c, gc.c, goops.c, guardians.c, hash.c, hashtab.c, hooks.c, ioext.c, iselect.c, keywords.c, lang.c, list.c, load.c, macros.c, modules.c, net_db.c, numbers.c, objects.c, objprop.c, options.c, pairs.c, ports.c, posix.c, print.c, procprop.c, procs.c, properties.c, ramap.c, random.c, read.c, regex-posix.c, root.c, scmsigs.c, script.c, simpos.c, socket.c, sort.c, srcprop.c, stackchk.c, stacks.c, stime.c, strings.c, strop.c, strorder.c, strports.c, struct.c, symbols.c, tag.c, threads.c, throw.c, unif.c, variable.c, vectors.c, version.c, vports.c, weaks.c: Makes sure the snarfer output inclusion is disabled when the snarfer is run on the file. Thanks to Lars J. Aas! * Makefile.am: Install guile-procedures.txt in version-specific directory to enable multiple installed guile versions. Suggested by Karl M. Hegbloom <karlheg@debian.org, patch by Matthias Koeppe. Marius Vollmer2000-11-171-0/+2