获取整数的负号并将其存储为char的最佳方法是什么?

时间:2019-06-19 08:36:26

标签: c char int negative-number

如何获取整数符号并将其存储在char中?一种方法是:

int n = -5
char c;
if(n<0)
    c = '-';
else
    c = '+';

或者:

char c = n < 0 ? '-' : '+';

但是有没有条件的方法吗?

3 个答案:

答案 0 :(得分:5)

这会在x86-64上使用gcc / clang创建无分支代码:

void storeneg(int X, char *C)
{
    *C='+';
    *C += (X<0)*('-'-'+');
}

https://gcc.godbolt.org/z/yua1go

答案 1 :(得分:5)

有一种最高效,最便携的方法,但它并没有赢得任何美容大奖。

我们可以假设,如果有符号整数的MSB始终为负,则总是将其置位。即使考虑异国签名格式(一个补码,一个符号大小),这也是100%可移植的假设。因此,最快的方法是简单地从整数中屏蔽MSB。

在位置CHAR_BIT * sizeof(n) - 1;上可以找到任何整数的MSB。在典型的32位主流系统上,例如8 * 4 - 1 = 31。

因此我们可以编写如下函数:

_Bool is_signed (int n)
{
  const unsigned int sign_bit_n = CHAR_BIT * sizeof(n) - 1;
  return (_Bool) ((unsigned int)n >> sign_bit_n);
}

在x86-64 gcc 9.1(-O3)上,这会产生非常有效的代码:

is_signed:
        mov     eax, edi
        shr     eax, 31
        ret

此方法的优点还在于,与诸如x < 0之类的代码不同,在移植时,它不会冒被翻译成“如果否定分支”指令的风险。

完整示例:

#include <limits.h>
#include <stdio.h>

_Bool is_signed (int n)
{
  const unsigned int sign_bit_n = CHAR_BIT * sizeof(n) - 1;
  return (_Bool) ((unsigned int)n >> sign_bit_n);
}

int main (void)
{
  int n = -1;

  const char SIGNS[] = {' ', '-'};
  char sign = SIGNS[is_signed(n)];
  putchar(sign);
}

反汇编(x86-64 gcc 9.1(-O3)):

is_signed:
        mov     eax, edi
        shr     eax, 31
        ret
main:
        sub     rsp, 8
        mov     rsi, QWORD PTR stdout[rip]
        mov     edi, 45
        call    _IO_putc
        xor     eax, eax
        add     rsp, 8
        ret

答案 2 :(得分:1)

Directory of D:\batch\tasks\shared\test-condaenv-users

06/27/2019  04:29 AM    <DIR>          .
06/27/2019  04:29 AM    <DIR>          ..
04/20/2018  01:28 PM            19,208 api-ms-win-core-console-l1-1-0.dll
04/20/2018  01:28 PM            18,696 api-ms-win-core-datetime-l1-1-0.dll
04/20/2018  01:28 PM            18,696 api-ms-win-core-debug-l1-1-0.dll
04/20/2018  01:28 PM            18,696 api-ms-win-core-errorhandling-l1-1-0.dll
04/20/2018  01:29 PM            22,280 api-ms-win-core-file-l1-1-0.dll
04/20/2018  01:37 PM            18,696 api-ms-win-core-file-l1-2-0.dll
04/20/2018  01:37 PM            18,696 api-ms-win-core-file-l2-1-0.dll
04/20/2018  01:37 PM            18,696 api-ms-win-core-handle-l1-1-0.dll
04/20/2018  01:37 PM            19,208 api-ms-win-core-heap-l1-1-0.dll
04/20/2018  01:37 PM            18,696 api-ms-win-core-interlocked-l1-1-0.dll
04/20/2018  01:37 PM            19,720 api-ms-win-core-libraryloader-l1-1-0.dll
04/20/2018  01:37 PM            21,256 api-ms-win-core-localization-l1-2-0.dll
04/20/2018  01:37 PM            19,208 api-ms-win-core-memory-l1-1-0.dll
04/20/2018  01:37 PM            18,696 api-ms-win-core-namedpipe-l1-1-0.dll
04/20/2018  01:37 PM            19,720 api-ms-win-core-processenvironment-l1-1-0.dll
04/20/2018  01:37 PM            20,744 api-ms-win-core-processthreads-l1-1-0.dll
04/20/2018  01:37 PM            19,208 api-ms-win-core-processthreads-l1-1-1.dll
04/20/2018  01:37 PM            18,184 api-ms-win-core-profile-l1-1-0.dll
04/20/2018  01:37 PM            19,208 api-ms-win-core-rtlsupport-l1-1-0.dll
04/20/2018  01:37 PM            18,696 api-ms-win-core-string-l1-1-0.dll
04/20/2018  01:37 PM            20,744 api-ms-win-core-synch-l1-1-0.dll
04/20/2018  01:37 PM            19,208 api-ms-win-core-synch-l1-2-0.dll
04/20/2018  01:37 PM            19,720 api-ms-win-core-sysinfo-l1-1-0.dll
04/20/2018  01:37 PM            19,208 api-ms-win-core-timezone-l1-1-0.dll
04/20/2018  01:37 PM            18,696 api-ms-win-core-util-l1-1-0.dll
04/20/2018  01:37 PM            19,720 api-ms-win-crt-conio-l1-1-0.dll
04/20/2018  01:37 PM            22,792 api-ms-win-crt-convert-l1-1-0.dll
04/20/2018  01:37 PM            19,208 api-ms-win-crt-environment-l1-1-0.dll
04/20/2018  01:37 PM            20,744 api-ms-win-crt-filesystem-l1-1-0.dll
04/20/2018  01:37 PM            19,720 api-ms-win-crt-heap-l1-1-0.dll
04/20/2018  01:37 PM            19,208 api-ms-win-crt-locale-l1-1-0.dll
04/20/2018  01:37 PM            27,912 api-ms-win-crt-math-l1-1-0.dll
04/20/2018  01:37 PM            26,888 api-ms-win-crt-multibyte-l1-1-0.dll
04/20/2018  01:37 PM            71,432 api-ms-win-crt-private-l1-1-0.dll
04/20/2018  01:37 PM            19,720 api-ms-win-crt-process-l1-1-0.dll
04/20/2018  01:37 PM            23,304 api-ms-win-crt-runtime-l1-1-0.dll
04/20/2018  01:37 PM            24,840 api-ms-win-crt-stdio-l1-1-0.dll
04/20/2018  01:37 PM            24,840 api-ms-win-crt-string-l1-1-0.dll
04/20/2018  01:37 PM            21,256 api-ms-win-crt-time-l1-1-0.dll
04/20/2018  01:37 PM            19,208 api-ms-win-crt-utility-l1-1-0.dll
11/13/2018  04:56 PM           329,368 concrt140.dll
06/27/2019  04:29 AM    <DIR>          conda-meta
06/27/2019  04:29 AM    <DIR>          DLLs
06/27/2019  04:29 AM    <DIR>          include
06/27/2019  04:29 AM    <DIR>          Lib
06/27/2019  04:29 AM    <DIR>          Library
06/27/2019  04:29 AM    <DIR>          libs
03/25/2019  08:21 PM            12,769 LICENSE_PYTHON.txt
11/13/2018  04:56 PM           625,808 msvcp140.dll
11/13/2018  04:56 PM            31,896 msvcp140_1.dll
11/13/2018  04:56 PM           195,248 msvcp140_2.dll
04/24/2019  08:30 PM            95,232 python.exe
04/24/2019  08:30 PM           438,272 python.pdb
04/24/2019  08:30 PM            51,712 python3.dll
04/24/2019  08:30 PM         3,745,792 python37.dll
04/24/2019  08:30 PM         9,523,200 python37.pdb
04/24/2019  08:30 PM            93,696 pythonw.exe
04/24/2019  08:30 PM           438,272 pythonw.pdb
06/27/2019  04:29 AM    <DIR>          Scripts
06/27/2019  04:29 AM    <DIR>          tcl
06/27/2019  04:29 AM    <DIR>          Tools
04/20/2018  01:37 PM         1,016,584 ucrtbase.dll
11/13/2018  04:56 PM           386,720 vccorlib140.dll
11/13/2018  04:56 PM           155,280 vcomp140.dll
11/13/2018  04:56 PM            87,200 vcruntime140.dll
              56 File(s)     18,091,625 bytes
              11 Dir(s)  69,282,779,136 bytes free
"\Lib" 
 Volume in drive D is Temporary Storage
 Volume Serial Number is 2AF3-E29E

 Directory of D:\batch\tasks\shared\test-condaenv-users\Lib

06/27/2019  04:29 AM    <DIR>          .
06/27/2019  04:29 AM    <DIR>          ..
03/25/2019  08:21 PM             5,580 abc.py
03/25/2019  08:21 PM            32,814 aifc.py
03/25/2019  08:21 PM               477 antigravity.py
03/25/2019  08:21 PM            95,103 argparse.py
03/25/2019  08:21 PM            12,575 ast.py
03/25/2019  08:21 PM            11,328 asynchat.py
06/27/2019  04:29 AM    <DIR>          asyncio
03/25/2019  08:21 PM            20,118 asyncore.py
03/25/2019  08:21 PM            20,380 base64.py
03/25/2019  08:21 PM            31,489 bdb.py
03/25/2019  08:21 PM            13,954 binhex.py
03/25/2019  08:21 PM             2,557 bisect.py
03/25/2019  08:21 PM            12,410 bz2.py
03/25/2019  08:21 PM            24,826 calendar.py
03/25/2019  08:21 PM            34,549 cgi.py
03/25/2019  08:21 PM            12,018 cgitb.py
03/25/2019  08:21 PM             5,435 chunk.py
03/25/2019  08:21 PM            14,860 cmd.py
03/25/2019  08:21 PM            10,619 code.py
03/25/2019  08:21 PM            36,287 codecs.py
03/25/2019  08:21 PM             5,994 codeop.py
06/27/2019  04:29 AM    <DIR>          collections
03/25/2019  08:21 PM             4,064 colorsys.py
03/25/2019  08:21 PM            13,649 compileall.py
06/27/2019  04:29 AM    <DIR>          concurrent
03/25/2019  08:21 PM            54,283 configparser.py
03/25/2019  08:21 PM            23,774 contextlib.py
03/25/2019  08:21 PM               129 contextvars.py
03/25/2019  08:21 PM             8,815 copy.py
03/25/2019  08:21 PM             7,017 copyreg.py
03/25/2019  08:21 PM             5,805 cProfile.py
03/25/2019  08:21 PM             3,346 crypt.py
03/25/2019  08:21 PM            16,180 csv.py
06/27/2019  04:29 AM    <DIR>          ctypes
06/27/2019  04:29 AM    <DIR>          curses
03/25/2019  08:21 PM            48,508 dataclasses.py
03/25/2019  08:21 PM            86,298 datetime.py
06/27/2019  04:29 AM    <DIR>          dbm
03/25/2019  08:21 PM               320 decimal.py
03/25/2019  08:21 PM            84,387 difflib.py
03/25/2019  08:21 PM            19,888 dis.py
06/27/2019  04:29 AM    <DIR>          distutils
03/25/2019  08:21 PM           104,284 doctest.py
03/25/2019  08:21 PM             2,815 dummy_threading.py
06/27/2019  04:29 AM    <DIR>          email
06/27/2019  04:29 AM    <DIR>          encodings
06/27/2019  04:29 AM    <DIR>          ensurepip
03/25/2019  08:21 PM            34,778 enum.py
03/25/2019  08:21 PM             9,830 filecmp.py
03/25/2019  08:21 PM            14,568 fileinput.py
03/25/2019  08:21 PM             4,056 fnmatch.py
03/25/2019  08:21 PM            15,143 formatter.py
03/25/2019  08:21 PM            23,639 fractions.py
03/25/2019  08:21 PM            35,257 ftplib.py
03/25/2019  08:21 PM            32,441 functools.py
03/25/2019  08:21 PM             4,756 genericpath.py
03/25/2019  08:21 PM             7,489 getopt.py
03/25/2019  08:21 PM             5,994 getpass.py
03/25/2019  08:21 PM            21,967 gettext.py
03/25/2019  08:21 PM             5,638 glob.py
03/25/2019  08:21 PM            20,338 gzip.py
03/25/2019  08:21 PM             9,534 hashlib.py
03/25/2019  08:21 PM            23,017 heapq.py
03/25/2019  08:21 PM             6,517 hmac.py
06/27/2019  04:29 AM    <DIR>          html
06/27/2019  04:29 AM    <DIR>          http
06/27/2019  04:29 AM    <DIR>          idlelib
03/25/2019  08:21 PM            53,292 imaplib.py
03/25/2019  08:21 PM             3,795 imghdr.py
03/25/2019  08:21 PM            10,536 imp.py
06/27/2019  04:29 AM    <DIR>          importlib
03/25/2019  08:21 PM           117,615 inspect.py
03/25/2019  08:21 PM             3,517 io.py
03/25/2019  08:21 PM            75,072 ipaddress.py
06/27/2019  04:29 AM    <DIR>          json
03/25/2019  08:21 PM             2,245 keyword.py
06/27/2019  04:29 AM    <DIR>          lib2to3
03/25/2019  08:21 PM             5,312 linecache.py
03/25/2019  08:21 PM            78,027 locale.py
06/27/2019  04:29 AM    <DIR>          logging
03/25/2019  08:21 PM            12,983 lzma.py
03/25/2019  08:21 PM             6,123 macpath.py
03/25/2019  08:21 PM            78,654 mailbox.py
03/25/2019  08:21 PM             8,104 mailcap.py
03/25/2019  08:21 PM            20,880 mimetypes.py
03/25/2019  08:21 PM            23,035 modulefinder.py
06/27/2019  04:29 AM    <DIR>          msilib
06/27/2019  04:29 AM    <DIR>          multiprocessing
03/25/2019  08:21 PM             5,566 netrc.py
03/25/2019  08:21 PM            43,088 nntplib.py
03/25/2019  08:21 PM            22,340 ntpath.py
03/25/2019  08:21 PM             2,584 nturl2path.py
03/25/2019  08:21 PM            10,244 numbers.py
03/25/2019  08:21 PM             5,824 opcode.py
03/25/2019  08:21 PM            10,863 operator.py
03/25/2019  08:21 PM            60,371 optparse.py
03/25/2019  08:21 PM            37,756 os.py
03/25/2019  08:21 PM            49,389 pathlib.py
03/25/2019  08:21 PM            62,544 pdb.py
03/25/2019  08:21 PM            57,837 pickle.py
03/25/2019  08:21 PM            91,220 pickletools.py
03/25/2019  08:21 PM             8,916 pipes.py
03/25/2019  08:21 PM            21,461 pkgutil.py
04/24/2019  07:46 PM            47,067 platform.py
03/25/2019  08:21 PM            29,885 plistlib.py
03/25/2019  08:21 PM            14,964 poplib.py
03/25/2019  08:21 PM            15,772 posixpath.py
03/25/2019  08:21 PM            20,884 pprint.py
03/25/2019  08:21 PM            22,046 profile.py
03/25/2019  08:21 PM            27,313 pstats.py
03/25/2019  08:21 PM             4,763 pty.py
03/25/2019  08:21 PM            15,137 pyclbr.py
03/25/2019  08:21 PM           106,731 pydoc.py
06/27/2019  04:29 AM    <DIR>          pydoc_data
03/25/2019  08:21 PM             8,001 py_compile.py
03/25/2019  08:21 PM            11,359 queue.py
03/25/2019  08:21 PM             7,254 quopri.py
03/25/2019  08:21 PM            27,557 random.py
03/25/2019  08:21 PM            15,192 re.py
03/25/2019  08:21 PM             5,267 reprlib.py
03/25/2019  08:21 PM             7,097 rlcompleter.py
03/25/2019  08:21 PM            11,959 runpy.py
03/25/2019  08:21 PM             6,442 sched.py
03/25/2019  08:21 PM             2,038 secrets.py
03/25/2019  08:21 PM            18,561 selectors.py
03/25/2019  08:21 PM             8,527 shelve.py
03/25/2019  08:21 PM            12,956 shlex.py
03/25/2019  08:21 PM            41,329 shutil.py
03/25/2019  08:21 PM             2,123 signal.py
06/27/2019  04:29 AM    <DIR>          site-packages
03/25/2019  08:21 PM            21,649 site.py
03/25/2019  08:21 PM            34,711 smtpd.py
03/25/2019  08:21 PM            44,210 smtplib.py
03/25/2019  08:21 PM             7,086 sndhdr.py
03/25/2019  08:21 PM            27,363 socket.py
03/25/2019  08:21 PM            26,922 socketserver.py
06/27/2019  04:29 AM    <DIR>          sqlite3
03/25/2019  08:21 PM            26,872 sre_compile.py
03/25/2019  08:21 PM             7,177 sre_constants.py
03/25/2019  08:21 PM            39,305 sre_parse.py
03/25/2019  08:21 PM            45,432 ssl.py
03/25/2019  08:21 PM             5,038 stat.py
03/25/2019  08:21 PM            20,651 statistics.py
03/25/2019  08:21 PM            11,564 string.py
03/25/2019  08:21 PM            12,917 stringprep.py
03/25/2019  08:21 PM               257 struct.py
03/25/2019  08:21 PM            69,966 subprocess.py
03/25/2019  08:21 PM            18,375 sunau.py
03/25/2019  08:21 PM             2,131 symbol.py
03/25/2019  08:21 PM             7,274 symtable.py
04/24/2019  07:46 PM            24,649 sysconfig.py
03/25/2019  08:21 PM            24,317 sysconfig.py.orig
03/25/2019  08:21 PM            11,408 tabnanny.py
03/25/2019  08:21 PM            92,617 tarfile.py
03/25/2019  08:21 PM            23,135 telnetlib.py
03/25/2019  08:21 PM            26,710 tempfile.py
06/27/2019  04:29 AM    <DIR>          test
03/25/2019  08:21 PM            19,494 textwrap.py
03/25/2019  08:21 PM             1,003 this.py
03/25/2019  08:21 PM            48,104 threading.py
03/25/2019  08:21 PM            13,444 timeit.py
06/27/2019  04:29 AM    <DIR>          tkinter
03/25/2019  08:21 PM             3,763 token.py
03/25/2019  08:21 PM            27,030 tokenize.py
03/25/2019  08:21 PM            28,543 trace.py
03/25/2019  08:21 PM            23,438 traceback.py
03/25/2019  08:21 PM            17,076 tracemalloc.py
03/25/2019  08:21 PM               879 tty.py
03/25/2019  08:21 PM           143,602 turtle.py
06/27/2019  04:29 AM    <DIR>          turtledemo
03/25/2019  08:21 PM             9,897 types.py
03/25/2019  08:21 PM            54,602 typing.py
06/27/2019  04:29 AM    <DIR>          unittest
06/27/2019  04:29 AM    <DIR>          urllib
03/25/2019  08:21 PM             6,816 uu.py
03/25/2019  08:21 PM            29,449 uuid.py
06/27/2019  04:29 AM    <DIR>          venv
03/25/2019  08:21 PM            20,242 warnings.py
03/25/2019  08:21 PM            18,229 wave.py
03/25/2019  08:21 PM            20,689 weakref.py
03/25/2019  08:21 PM            23,097 webbrowser.py
06/27/2019  04:29 AM    <DIR>          wsgiref
03/25/2019  08:21 PM             5,913 xdrlib.py
06/27/2019  04:29 AM    <DIR>          xml
06/27/2019  04:29 AM    <DIR>          xmlrpc
03/25/2019  08:21 PM             7,535 zipapp.py
03/25/2019  08:21 PM            80,379 zipfile.py
03/25/2019  08:21 PM             1,801 _bootlocale.py
03/25/2019  08:21 PM            26,424 _collections_abc.py
03/25/2019  08:21 PM             8,749 _compat_pickle.py
03/25/2019  08:21 PM             5,340 _compression.py
03/25/2019  08:21 PM             5,117 _dummy_thread.py
03/25/2019  08:21 PM            14,598 _markupbase.py
03/25/2019  08:21 PM            19,138 _osx_support.py
03/25/2019  08:21 PM           228,535 _pydecimal.py
03/25/2019  08:21 PM            91,166 _pyio.py
03/25/2019  08:21 PM             6,186 _py_abc.py
03/25/2019  08:21 PM             3,115 _sitebuiltins.py
03/25/2019  08:21 PM            25,504 _strptime.py
03/25/2019  08:21 PM             7,214 _threading_local.py
03/25/2019  08:21 PM             5,679 _weakrefset.py
03/25/2019  08:21 PM             5,101 __future__.py
03/25/2019  08:21 PM                64 __phello__.foo.py
06/27/2019  04:29 AM    <DIR>          __pycache__
             172 File(s)      4,330,005 bytes
              34 Dir(s)  69,282,762,752 bytes free
"\Lib\site-packages" 
 Volume in drive D is Temporary Storage
 Volume Serial Number is 2AF3-E29E

 Directory of D:\batch\tasks\shared\test-condaenv-users\Lib\site-packages

06/27/2019  04:29 AM    <DIR>          .
06/27/2019  04:29 AM    <DIR>          ..
06/27/2019  04:29 AM    <DIR>          certifi
06/20/2019  10:54 PM             2,990 certifi-2019.06.16-py3.7.egg-info
04/23/2019  01:18 AM               126 easy_install.py
06/27/2019  04:29 AM    <DIR>          pip
06/27/2019  04:29 AM    <DIR>          pip-19.1.1-py3.7.egg-info
06/27/2019  04:29 AM    <DIR>          pkg_resources
03/25/2019  08:21 PM               119 README.txt
06/27/2019  04:29 AM    <DIR>          setuptools
06/27/2019  04:29 AM    <DIR>          setuptools-41.0.1-py3.7.egg-info
06/27/2019  04:29 AM    <DIR>          wheel
06/27/2019  04:29 AM    <DIR>          wheel-0.33.4-py3.7.egg-info
06/28/2018  10:27 PM             5,788 wincertstore-0.2-py3.7.egg-info
10/23/2013  07:30 AM            11,873 wincertstore.py
06/27/2019  04:29 AM    <DIR>          __pycache__
               5 File(s)         20,896 bytes
              11 Dir(s)  69,282,762,752 bytes free
  • Directory of D:\batch\tasks\shared\test-condaenv-users\Library 06/27/2019 04:29 AM <DIR> . 06/27/2019 04:29 AM <DIR> .. 06/27/2019 04:29 AM <DIR> bin 05/29/2019 06:11 PM 412 ct_log_list.cnf 05/29/2019 06:11 PM 412 ct_log_list.cnf.dist 06/27/2019 04:29 AM <DIR> include 06/27/2019 04:29 AM <DIR> lib 06/27/2019 04:29 AM <DIR> misc 05/29/2019 06:11 PM 10,909 openssl.cnf 05/29/2019 06:11 PM 10,909 openssl.cnf.dist 06/27/2019 04:29 AM <DIR> ssl 4 File(s) 22,642 bytes 7 Dir(s) 69,282,762,752 bytes free "\Library\bin" Volume in drive D is Temporary Storage Volume Serial Number is 2AF3-E29E Directory of D:\batch\tasks\shared\test-condaenv-users\Library\bin 06/27/2019 04:29 AM <DIR> . 06/27/2019 04:29 AM <DIR> .. 04/20/2018 01:28 PM 19,208 api-ms-win-core-console-l1-1-0.dll 04/20/2018 01:28 PM 18,696 api-ms-win-core-datetime-l1-1-0.dll 04/20/2018 01:28 PM 18,696 api-ms-win-core-debug-l1-1-0.dll 04/20/2018 01:28 PM 18,696 api-ms-win-core-errorhandling-l1-1-0.dll 04/20/2018 01:29 PM 22,280 api-ms-win-core-file-l1-1-0.dll 04/20/2018 01:37 PM 18,696 api-ms-win-core-file-l1-2-0.dll 04/20/2018 01:37 PM 18,696 api-ms-win-core-file-l2-1-0.dll 04/20/2018 01:37 PM 18,696 api-ms-win-core-handle-l1-1-0.dll 04/20/2018 01:37 PM 19,208 api-ms-win-core-heap-l1-1-0.dll 04/20/2018 01:37 PM 18,696 api-ms-win-core-interlocked-l1-1-0.dll 04/20/2018 01:37 PM 19,720 api-ms-win-core-libraryloader-l1-1-0.dll 04/20/2018 01:37 PM 21,256 api-ms-win-core-localization-l1-2-0.dll 04/20/2018 01:37 PM 19,208 api-ms-win-core-memory-l1-1-0.dll 04/20/2018 01:37 PM 18,696 api-ms-win-core-namedpipe-l1-1-0.dll 04/20/2018 01:37 PM 19,720 api-ms-win-core-processenvironment-l1-1-0.dll 04/20/2018 01:37 PM 20,744 api-ms-win-core-processthreads-l1-1-0.dll 04/20/2018 01:37 PM 19,208 api-ms-win-core-processthreads-l1-1-1.dll 04/20/2018 01:37 PM 18,184 api-ms-win-core-profile-l1-1-0.dll 04/20/2018 01:37 PM 19,208 api-ms-win-core-rtlsupport-l1-1-0.dll 04/20/2018 01:37 PM 18,696 api-ms-win-core-string-l1-1-0.dll 04/20/2018 01:37 PM 20,744 api-ms-win-core-synch-l1-1-0.dll 04/20/2018 01:37 PM 19,208 api-ms-win-core-synch-l1-2-0.dll 04/20/2018 01:37 PM 19,720 api-ms-win-core-sysinfo-l1-1-0.dll 04/20/2018 01:37 PM 19,208 api-ms-win-core-timezone-l1-1-0.dll 04/20/2018 01:37 PM 18,696 api-ms-win-core-util-l1-1-0.dll 04/20/2018 01:37 PM 19,720 api-ms-win-crt-conio-l1-1-0.dll 04/20/2018 01:37 PM 22,792 api-ms-win-crt-convert-l1-1-0.dll 04/20/2018 01:37 PM 19,208 api-ms-win-crt-environment-l1-1-0.dll 04/20/2018 01:37 PM 20,744 api-ms-win-crt-filesystem-l1-1-0.dll 04/20/2018 01:37 PM 19,720 api-ms-win-crt-heap-l1-1-0.dll 04/20/2018 01:37 PM 19,208 api-ms-win-crt-locale-l1-1-0.dll 04/20/2018 01:37 PM 27,912 api-ms-win-crt-math-l1-1-0.dll 04/20/2018 01:37 PM 26,888 api-ms-win-crt-multibyte-l1-1-0.dll 04/20/2018 01:37 PM 71,432 api-ms-win-crt-private-l1-1-0.dll 04/20/2018 01:37 PM 19,720 api-ms-win-crt-process-l1-1-0.dll 04/20/2018 01:37 PM 23,304 api-ms-win-crt-runtime-l1-1-0.dll 04/20/2018 01:37 PM 24,840 api-ms-win-crt-stdio-l1-1-0.dll 04/20/2018 01:37 PM 24,840 api-ms-win-crt-string-l1-1-0.dll 04/20/2018 01:37 PM 21,256 api-ms-win-crt-time-l1-1-0.dll 04/20/2018 01:37 PM 19,208 api-ms-win-crt-utility-l1-1-0.dll 11/13/2018 04:56 PM 329,368 concrt140.dll 06/27/2019 04:29 AM 6,548 c_rehash.pl 05/29/2019 06:11 PM 3,407,360 libcrypto-1_1-x64.dll 05/29/2019 06:11 PM 10,088,448 libcrypto-1_1-x64.pdb 05/29/2019 06:11 PM 681,472 libssl-1_1-x64.dll 05/29/2019 06:11 PM 2,322,432 libssl-1_1-x64.pdb 11/13/2018 04:56 PM 625,808 msvcp140.dll 11/13/2018 04:56 PM 31,896 msvcp140_1.dll 11/13/2018 04:56 PM 195,248 msvcp140_2.dll 05/29/2019 06:11 PM 542,720 openssl.exe 05/29/2019 06:11 PM 2,527,232 openssl.pdb 04/22/2019 06:33 PM 1,028,608 sqlite3.dll 04/22/2019 06:33 PM 1,303,552 sqlite3.exe 04/20/2018 01:37 PM 1,016,584 ucrtbase.dll 11/13/2018 04:56 PM 386,720 vccorlib140.dll 11/13/2018 04:56 PM 155,280 vcomp140.dll 11/13/2018 04:56 PM 87,200 vcruntime140.dll 57 File(s) 25,601,052 bytes 2 Dir(s) 69,282,762,752 bytes free Volume in drive D is Temporary Storage Volume Serial Number is 2AF3-E29E Directory of D:\batch\tasks\shared\test-condaenv-users\libs 06/27/2019 04:29 AM <DIR> . 06/27/2019 04:29 AM <DIR> .. 04/24/2019 08:30 PM 170,564 python3.lib 04/24/2019 08:29 PM 342,616 python37.lib 04/24/2019 08:30 PM 1,750 _tkinter.lib 3 File(s) 514,930 bytes 2 Dir(s) 69,282,762,752 bytes free char c = 43 + signbit(n) * 2 ;
  • char 43'+'
  • signbit(NEGATIVE INTEGER)为char 45,转换为'-'

true包含在cmath in C++math.h in C