According to :help Number, a Number variable is a 32-bit signed integer.
No mention of anything else.
According to :help limits, a Number variable can have an absolute value
larger than 2^31 (i.e. 2 * 1024^3) on 64-bit systems.
AFAICT, the former seems to be true: Experiments with :echo and various
Number values and expressions seem to indicate that even on 64-bit Vim,
integers are silently truncated to their lower 32 bits. Even when typing
(with or without the 0x prefix) long digit strings that would even
exceed 2^64, only the 32 lower bits of the result are kept, and no error
is ever given. Similarly, the float2nr() function interprets any
positive value bigger than (2^31 - 1) as "out of range for a Number".
Examples:
:echo (0x800000000000 == 0)
1
:echo 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-1
:echo 0x1000FFFFFFFF
-1
:echo (0x1000FFFFFFFF < 0)
1
:echo (float2nr(pow(2,35)) == 0x7fffffff)
1
Inspection of auto/config.* shows that (AFAICT) Vim is configured for a
64-bit processor, but with a C "int" type of 32 bits. The compiler
identifies itself (first line of gcc --version) as:
gcc (SUSE Linux) 4.5.1 20101208 [gcc-4_5-branch revision 167585]
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Aug 28 2011 20:41:41)
Included patches: 1-289
Compiled by [email protected]
Huge version with GTK2-GNOME GUI. Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset
+cindent +clientserver +clipboard +cmdline_compl +cmdline_hist
+cmdline_info +comments +conceal +cryptv +cscope +cursorbind
+cursorshape +dialog_con_gui +diff +digraphs +dnd -ebcdic +emacs_tags +eval
+ex_extra +extra_search +farsi +file_in_path +find_in_path +float
+folding -footer +fork() +gettext -hangul_input +iconv +insert_expand
+jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds
+localmap +lua +menu +mksession +modify_fname +mouse +mouseshape
+mouse_dec +mouse_gpm -mouse_jsbterm +mouse_netterm -mouse_sysmouse
+mouse_xterm +multi_byte +multi_lang -mzscheme +netbeans_intg +path_extra
+perl +persistent_undo +postscript +printer +profile +python -python3
+quickfix +reltime +rightleft +ruby +scrollbind +signs +smartindent
-sniff +startuptime +statusline -sun_workshop +syntax +tag_binary
-tag_old_static -tag_any_white +tcl +terminfo +termresponse +textobjects
+title +toolbar +user_commands +vertsplit +virtualedit +visual
+visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup
+X11 -xfontset +xim +xsmp_interact +xterm_clipboard +xterm_save
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "$VIM/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/usr/local/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -pthread
-I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include
-I/usr/include/atk-1.0 -I/usr/include/cairo
-I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0
-I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include
-I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng14
-DORBIT2=1 -pthread -D_REENTRANT -I/usr/include/libgnomeui-2.0
-I/usr/include/libart-2.0 -I/usr/include/gconf/2
-I/usr/include/gnome-keyring-1 -I/usr/include/libgnome-2.0
-I/usr/include/libbonoboui-2.0 -I/usr/include/libgnomecanvas-2.0
-I/usr/include/gtk-2.0 -I/usr/include/gdk-pixbuf-2.0
-I/usr/include/gnome-vfs-2.0 -I/usr/lib64/gnome-vfs-2.0/include
-I/usr/include/orbit-2.0 -I/usr/include/glib-2.0
-I/usr/lib64/glib-2.0/include -I/usr/include/libbonobo-2.0
-I/usr/include/bonobo-activation-2.0 -I/usr/include/libxml2
-I/usr/include/pango-1.0 -I/usr/include/gail-1.0
-I/usr/include/freetype2 -I/usr/include/atk-1.0
-I/usr/lib64/gtk-2.0/include -I/usr/include/cairo
-I/usr/include/pixman-1 -I/usr/include/libpng14 -O2
-fno-strength-reduce -Wall -D_FORTIFY_SOURCE=1 -I/usr/include
-D_LARGEFILE64_SOURCE=1
Linking: gcc -L. -rdynamic -Wl,-export-dynamic -Wl,-E
-Wl,-rpath,/usr/lib/perl5/5.12.3/x86_64-linux-thread-multi/CORE -L.
-rdynamic -Wl,-export-dynamic -Wl,-E
-Wl,-rpath,/usr/lib/perl5/5.12.3/x86_64-linux-thread-multi/CORE -L.
-rdynamic -Wl,-export-dynamic -Wl,-E
-Wl,-rpath,/usr/lib/perl5/5.12.3/x86_64-linux-thread-multi/CORE
-L/usr/local/lib -Wl,--as-needed -Wl,--as-needed -Wl,--as-needed -o vim
-pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0
-lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lm -lcairo -lpng14
-lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0
-lgthread-2.0 -lrt -lglib-2.0 -lgnomeui-2 -lSM -lICE -lbonoboui-2
-lgnomevfs-2 -lgnomecanvas-2 -lgnome-2 -lpopt -lbonobo-2
-lbonobo-activation -lORBit-2 -lart_lgpl_2 -lgtk-x11-2.0 -lgdk-x11-2.0
-latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lm
-lcairo -lpango-1.0 -lfreetype -lfontconfig -lpng14 -lgconf-2
-lgmodule-2.0 -lgobject-2.0 -lgthread-2.0 -lrt -lglib-2.0 -lSM -lICE
-lXpm -lXt -lX11 -lXdmcp -lSM -lICE -lm -lncurses -lnsl -lacl -lattr
-lgpm -ldl -L/usr/lib -llua -Wl,-E
-Wl,-rpath,/usr/lib/perl5/5.12.3/x86_64-linux-thread-multi/CORE
-L/usr/local/lib64 -fstack-protector
-L/usr/lib/perl5/5.12.3/x86_64-linux-thread-multi/CORE -lperl -lm -ldl
-lcrypt -lpthread -L/usr/lib64/python2.7/config -lpython2.7 -lpthread
-ldl -lutil -lm -Xlinker -export-dynamic -L/usr/lib64 -ltcl8.5 -ldl
-lieee -lm -Wl,-R -Wl,/usr/lib64 -L/usr/lib64 -lruby -lrt -ldl -lcrypt
-lm -L/usr/lib64
When compiling Vim, the linker outputs a lot of messages about skipping
incompatible libraries /usr/lib/*.so (presumably it uses the libraries
of the same name in /usr/lib64).
Best regards,
Tony.
--
You better believe that marijuana can cause castration. Just suppose
your girlfriend gets the munchies!
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php