integer

    0热度

    1回答

    我有一个数据类型: data AbstractInteger = Zero | Succ AbstractInteger | Pred AbstractInteger deriving (Show, Eq) 我已经有两个功能: 1)转换AbstractInteger成整数: aiToInteger :: AbstractInteger ->

    -5热度

    3回答

    我有一个固定大小(10)的int数组,它没有完全填充。 我想计算数组中有多少个整数,这样我就知道如果我想向数组中添加一个整数,那么索引数组的值是多少。 (所以我不会取代另一个值) //Define Array int counter=0; int scores[10] = {92,87,94,99,96}; //Count how many elements are in the scor

    0热度

    1回答

    我试图计算一个整数和一个浮点数。听起来很简单吧? 然而,当我执行下面的代码: <?php $decimals = 2; $dec_point = ','; $thousands_sep = '.'; $net_no = 851.12; $net_no = number_format($net_no,$decimals,$dec_point,$thousands_sep); $mon

    2热度

    1回答

    我正在寻找一个将两个(正数)整数映射为一个新整数的函数,该整数可以反转为原始组合。 之前已询问过该问题,例如Mapping two integers to one, in a unique and deterministic way。区别在于其中一个整数被绑定到一个非常小的上限,例如50.另一个整数是未绑定的。 我试图解决的是,我有1-50数组1 - 最大整数(但主要是< 10.000.000)。

    0热度

    2回答

    我想通过casting连接一个整数与现有字符串,并使用+附加连接。但它不起作用。 package main import ( "fmt" ) func main() { a := 4 b := "The value of a is " fmt.Println(b + string(a)) } 这会在go playground上打印一个垃圾字符

    -1热度

    2回答

    我试图从两个提示(这将需要一个字符串)解析一个整数,并将两个答案添加在一起。到目前为止,提示工作,但没有像预期的那样写入文档。你能告诉我为什么我的代码不能正确显示吗? <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Chapter 2, Example 6</title> </head

    -1热度

    3回答

    我正在处理一个处理monetairy金额的PHP脚本,因此需要精确到2位小数。为此,我将用户输入转换为一个数字,并将其乘以100,然后将其转换为int。这工作正常,直到我最近发现一个数字,当投到int时增加1。 的故障代码: $number = (int)(str_replace(',','.',$_POST["input"])*100); ,让问题的数量2509,22(我住在荷兰,所以我们使

    0热度

    2回答

    小问题,也许这是一个基本的问题....但 ub的价值应该是什么? 假设getuploadedBytes返回一个Int, ub的值应该是什么? 方法和右操作符之间的最小值或最大值? ub = that._getUploadedBytes(jqXHR) || (ub + o.chunkSize);

    0热度

    6回答

    我需要有计算后的百分比符号,我怎样才能改变这种代码,以便将错误: TypeError: unsupported operand type(s) for +: 'int' and 'str' 不显示。要删除小数点,计算为'int'。 global score score = 2 def test(score): percentage = int(((score)/5)*100)

    0热度

    1回答

    try { Character.isDigit(Integer.parseInt(txtWeight.getText())); } catch (java.lang.NumberFormatException ex) { JOptionPane.showMessageDialog(null, "Enter a number"); pnlStart.s