literals

What does the numerical literal 0.e0f mean?

﹥>﹥吖頭↗ 提交于 2019-12-06 07:54:01
I am currently trying to debug an uninitialized memory error. I have now come across the numerical literal 0.e0f in the OpenBlas source code (which is what the debugger is currently at) what does that mean? The context is this: if ((alpha_r == 0.e0f) && (alpha_i == 0.e0f)) return; The 0.e0f evaluates to 0 apparently. A floating-point literals have two syntaxes. The first one consists of the following parts: nonempty sequence of decimal digits containing a decimal point character (defines significand) (optional) e or E followed with optional minus or plus sign and nonempty sequence of decimal

Scala hex literal for bytes

蓝咒 提交于 2019-12-06 04:05:50
Hex literal containing A-F digit are converting to int by default. When I am trying to declear an Int with 0x it is creating correctly. val a: Int = 0x34 val b: Int = 0xFF But when I am trying to declear a Byte with 0x second line is not compiling val a: Byte = 0x34 val b: Byte = 0xFF // compilation error I have found a workaround that is val a: Byte = 0x34 val b: Byte = 0xFF.toByte But is there any decent way to declear a Byte from its hex literal? For example I am trying to declear a Byte array in a Test method in this way anObject.someMethod(1, 1.1f, 0xAB, "1") shouldBe Array[Byte](0xAF,

Strange cross-threading UI errors

流过昼夜 提交于 2019-12-06 00:46:13
问题 I'm writing a WinForms app which has two modes: console or GUI. Three projects within the same solution, one for the console app, one for the UI forms and the third to hold the logic that the two interfaces will both connect too. The Console app runs absolutely smoothly. A model which holds the user-selections, it has an IList<T> where T is a local object, Step , which implements INotifyPropertyChanged , so in the UI this is mounted on to a DataGridView. All is fine at runtime, the initial

Underscores in literals are not supported at this language level

倖福魔咒の 提交于 2019-12-05 17:53:44
I got this error when creating a final double using underscores to make the double more readable. It was declared in a run() method. public void run() { final double nanoSeconds = 1_000_000_000.0 / 60.0; } I'm using IntelliJ IDEA 12. In IntelliJ IDEA you have to change Project language level in project settings to 7.0 level: Yes..you need to change the default language level settings if you are using and IDE. For IntelliJ users it is under File --> Project Structure --> Projects. I found with my project that had modules, I had to do this in the modules settings as well. 来源: https:/

what is the difference between 'Float a = 3f' and 'Float a = 3.0' in java?

南楼画角 提交于 2019-12-05 15:00:49
If I perform 97346822*3f, result is 2.9204048E8, however 97346822*3.0 gives me 2.92040466E8. Please explain. The number 3.0 is the literal representation of a double value (it's equivalent to 3.0d ), whereas 3.0f is a float value. The different precisions explain why you're getting different results - a double is stored using 64-bits, a float uses 32-bits. 97346822*3.0 will be treated as double . Based on oracle tutorial The double data type is a double-precision 64-bit IEEE 754 floating point. Its range of values is beyond the scope of this discussion, but is specified in the Floating-Point

clearTimeout() not working

谁说我不能喝 提交于 2019-12-05 11:31:25
In the following code the clearTimeout() function doesn't seem to clear the timer. Please note: I've stripped the code down a bit to show the relevent parts. Any ideas? var Gallery = { next: function() { // does stuff }, close: function() { Gallery.slideshow("off"); }, slideshow: function(sw) { if (sw == "off") {clearTimeout(timer);} var timer = setTimeout(function() {Gallery.next();Gallery.slideshow();}, 1000); }, }; FULL CODE: <!doctype html> <html> <head> <meta charset="utf-8"> <title>Gallery</title> <meta name="description" content=" "> <meta name="author" content=" "> <link rel=

This is a bug in sbcl?

故事扮演 提交于 2019-12-05 11:28:32
Why happen this in sbcl? Maybe a bug? (defclass myclass () ((s1 :initform '((a . 1) (b . 2))) (s2 :initform '((a . 1) (b . 2))))) (defparameter ins (make-instance 'myclass)) (setf (cdr (assoc 'a (slot-value ins 's1))) 43) ;; change only slot s1 ;; here my problem (slot-value ins 's1) ;; => ((a . 44) (b . 2))) (slot-value ins 's2) ;; => ((a . 44) (b . 2))) But if change :initform to : (defclass myclass () ((s1 :initform '((a . 1) (b . 2))) (s2 :initform '((a . 1) (b . 3))))) The problem disappears I test this in sbcl 1.4.3 and 1.4.11 . In clisp it seems that the problem does not arise. No. You

Too many characters in character literal?

偶尔善良 提交于 2019-12-05 10:33:57
Can you tell me please what is wrong with this code??? About to getting crazy!!! <asp:LinkButton ID="LinkButton1" OnClick="DivAc('griddiv')" Font-Size="Smaller" runat="server" CommandName='<%# Eval("harf").ToString().ToUpper()%>'><%# Eval("harf").ToString().ToUpper() %></asp:LinkButton> Error: Too many characters in character literal... :( Is DivAc('griddiv') a javascript function? Then you have to use OnClientClick instead of OnClick . OnClick is reserved for .NET functions. With OnClientClick you generates the OnClick-attribute in HTML. This is probably a bit confusing. So this is what you

Insert a <br /> tag programmatically (VB.NET)

二次信任 提交于 2019-12-05 09:26:00
I'm trying to dynamically add results to this display and I simply want to put a break tag after a label to start putting information on the next line. For some reason, Using a literal isn't working for me. Is there a better way to do this or should I just use tables? Dim break As LiteralControl break = New LiteralControl("<br />") divListenerInfo.Controls.Add(break) That's part of the code that I'm attempting to use. Let me clarify what I said: It's not working as in the line break isn't showing up on the webpage. It's compiling fine and there is nothing wrong with the code. It just doesn't

Is the literal 0xffffffff int or unsigned in C++

为君一笑 提交于 2019-12-05 09:18:15
问题 According to this, integer literals without type suffix are always int s. However, both gcc and clang interpret 0xffffffff (or any literal which explicitly sets the sign bit other than using the - ) as unsigned. Which is correct? (according to this the compilers are) 回答1: Per Paragraph 2.14.2/2 of the C++11 Standard, The type of an integer literal is the first of the corresponding list in Table 6 in which its value can be represented. Table 6 reports that for hexadecimal constants, the type