Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

15
LINES

< > BotCompany Repo | #1012016 // ai_spec_compareNumbers

JavaX fragment (include)

static void ai_spec_compareNumbers(S term) {
  for ping (Web web : indexedWebs(term))
    ai_spec_compareNumbers(web);
}

static void ai_spec_compareNumbers(Web web) {
  for (WebRelation r : web_relationsNamed(web, "is bigger than?")) {
    S a = web_text(r.a), b = web_text(r.b);
    if (isInteger(a) && isInteger(b)) {
      int cmp = bigint(a).compareTo(bigint(b));
      S rel = cmp > 0 ? "is bigger than" : "is not bigger than";
      ai_postTriple(a, rel, b);
    }
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1012016
Snippet name: ai_spec_compareNumbers
Eternal ID of this version: #1012016/1
Text MD5: 334a93d038c38045053ca403bed723d5
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-11-16 04:03:51
Source code size: 491 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 329 / 340
Referenced in: [show references]