diff options
author | David McMackins II <contact@mcmackins.org> | 2017-02-16 12:02:20 -0600 |
---|---|---|
committer | David McMackins II <contact@mcmackins.org> | 2017-02-16 12:02:20 -0600 |
commit | c0e14c93609fd436931caaf49d89fb6d2f2c6ea5 (patch) | |
tree | 5a1db1d1deb999dd0d9bfcee24250ff07cc73c84 | |
parent | 288d5f4168f53648264ddb4ced49b14d9a4242c5 (diff) |
Fix printing negative E values
-rw-r--r-- | src/util.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -1,6 +1,6 @@ /* * LiberTI - TI-like calculator designed for LibreCalc - * Copyright (C) 2016 Delwink, LLC + * Copyright (C) 2016-2017 Delwink, LLC * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -46,10 +46,14 @@ load_expr_num (struct tib_expr *dest, const char *src) if (e >= 0) { tib_expr_delete (dest, e); - dest->data[e] = TIB_CHAR_EPOW10; + + if ('+' == dest->data[e]) + dest->data[e] = TIB_CHAR_EPOW10; + else + rc = tib_expr_insert (dest, e, TIB_CHAR_EPOW10); } - return 0; + return rc; } const char * |